JavaでAndroidのアプリを作成をしています。
アプリを開いた後にログイン画面へ移りたいのですが
エラーになってしまいます。
Runはできるのですが
アプリが開かない状況です><
原因がわからないので、どなたか教えていただけますと幸いです。
java
1Login.java 2 3import android.content.Intent; 4import android.graphics.Typeface; 5import android.os.Handler; 6import android.support.v7.app.AppCompatActivity; 7import android.os.Bundle; 8import android.view.View; 9import android.view.WindowManager; 10import android.widget.Button; 11import android.widget.TextView; 12 13public class Login extends AppCompatActivity { 14 15 Button btnSignIn, btnSignUp; 16 TextView txtSlogan; 17 18 @Override 19 protected void onCreate(Bundle savedInstanceState) { 20 super.onCreate(savedInstanceState); 21 setContentView(R.layout.login); 22 23 btnSignIn = (Button) findViewById(R.id.btnSignIn); 24 btnSignUp = (Button) findViewById(R.id.btnSingUp); 25 26 27 txtSlogan = (TextView) findViewById(R.id.txtSlogan); 28 Typeface face = Typeface.createFromAsset(getAssets(), "fonts/NABILA.TTF"); 29 txtSlogan.setTypeface(face); 30 31 btnSignIn.setOnClickListener(new View.OnClickListener() { 32 @Override 33 public void onClick(View v) { 34 35 } 36 }); 37 38 btnSignUp.setOnClickListener(new View.OnClickListener() { 39 @Override 40 public void onClick(View v) { 41 42 } 43 }); 44 } 45}
java
1Login.xml 2 3<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 4 xmlns:app="http://schemas.android.com/apk/res-auto" 5 xmlns:tools="http://schemas.android.com/tools" 6 android:layout_width="match_parent" 7 android:layout_height="match_parent" 8 android:background="@drawable/login_image" 9 tools:context=".Login"> 10 11 12 <LinearLayout 13 android:orientation="vertical" 14 android:layout_centerInParent="true" 15 android:layout_width="wrap_content" 16 android:layout_height="wrap_content"> 17 18 <ImageView 19 android:src="@drawable/aft_logo" 20 android:layout_width="200dp" 21 android:layout_height="200dp" /> 22 23 <TextView 24 android:gravity="center" 25 android:id="@+id/txtSlogan" 26 android:text="何か文章入れる〜" 27 android:textColor="@android:color/white" 28 android:layout_width="200dp" 29 android:layout_height="wrap_content" /> 30 </LinearLayout> 31 32 33 <LinearLayout 34 android:orientation="horizontal" 35 android:layout_alignParentBottom="true" 36 android:weightSum="2" 37 android:layout_width="match_parent" 38 android:layout_height="wrap_content"> 39 40 <info.hoang8f.widget.FButton 41 android:id="@+id/btnSingUp" 42 android:text="新規会員登録" 43 android:textColor="@android:color/white" 44 android:layout_weight="1" 45 android:layout_width="0dp" 46 android:layout_height="wrap_content" 47 android:layout_margin="8dp" 48 app:buttonColor="@color/btnSignUp" 49 app:shadowColor="@android:color/black" 50 app:shadowEnabled="true" 51 app:shadowHeight="5dp" 52 app:cornerRadius="4dp" 53 /> 54 55 <info.hoang8f.widget.FButton 56 android:id="@+id/btnSignIn" 57 android:text="ログイン" 58 android:textColor="@android:color/white" 59 android:layout_weight="1" 60 android:layout_width="0dp" 61 android:layout_height="wrap_content" 62 android:layout_margin="8dp" 63 app:buttonColor="@color/btnSignIn" 64 app:shadowColor="@android:color/black" 65 app:shadowEnabled="true" 66 app:shadowHeight="5dp" 67 app:cornerRadius="4dp" 68 /> 69 70 </LinearLayout> 71 72</RelativeLayout>
java
1Android.Manifest.xml 2 3<?xml version="1.0" encoding="utf-8"?> 4<manifest xmlns:android="http://schemas.android.com/apk/res/android" 5 package="jp.myapplication"> 6 7 <uses-permission android:name="android.permission.INTERNET" /> 8 9 <!-- To auto-complete the email text field in the login form with the user's emails --> 10 <uses-permission android:name="android.permission.GET_ACCOUNTS" /> 11 <uses-permission android:name="android.permission.READ_PROFILE" /> 12 <uses-permission android:name="android.permission.READ_CONTACTS" /> 13 14 <application 15 android:allowBackup="true" 16 android:icon="@mipmap/ic_launcher" 17 android:label="@string/app_name" 18 android:roundIcon="@mipmap/ic_launcher_round" 19 android:supportsRtl="true" 20 android:theme="@style/AppTheme"> 21 <activity 22 android:name=".Login" 23 android:label="@string/app_name"> 24 <intent-filter> 25 <action android:name="android.intent.action.MAIN" /> 26 27 <category android:name="android.intent.category.LAUNCHER" /> 28 </intent-filter> 29 30 </activity> 31 <activity android:name=".Product_box" /> 32 <activity android:name=".Product_carrot" /> 33 <activity android:name=".Product_garlic" /> 34 <activity android:name=".Product_onion" /> 35 <activity android:name=".MainActivity" /> 36 <activity android:name=".Home" /> 37 38 </application> 39</manifest>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/18 07:02
2018/07/18 14:20 編集
2018/07/21 09:17