0

私は現在の活動を開始する際にこのコードを書いていますが、現在のアクティビティを起動するとがクラッシュします。Android暗黙のインテント

SharedPreferences signShared = getSharedPreferences("ZapLukShared",MODE_PRIVATE); 
sharedUserId = signShared.getInt("logUser_Id",0); 
sharedOtpVerified = signShared.getBoolean("OtpVerified", false); 
if(sharedOtpVerified==false) {   
    Intent i=new Intent(MainActivty.this,MainActivity.class); 
    startActivity(i);  
} 
else {   
    Intent i2=new Intent(MainActivity.this,MainPageActivity.class); 
    startActivity(i2); 
} 
+0

あなたのクラッシュログ –

+0

ActivityManager追加:開始:意図は{= android.intent.action.MAIN働きますcat = [android.intent.category.LAUNCHER] cmp = com.example.zapapp/.MainActivity} – vishwa

+0

問題のあなたのandroid-menifestファイルを追加してください。 –

答えて

0

あなたが同じ活動のままにしたい場合は、意図を開始する必要がいけないよりも、

SharedPreferences signShared = getSharedPreferences("ZapLukShared",MODE_PRIVATE); 
sharedUserId = signShared.getInt("logUser_Id",0); 
sharedOtpVerified = signShared.getBoolean("OtpVerified", false); 
if(sharedOtpVerified==false) {   
    //no need to start intent if you want to remain in same activity 
} 
else {   
    Intent i2=new Intent(MainActivity.this,MainPageActivity.class); 
    startActivity(i2); 
} 
+0

解決しなければ私に知らせる@vishwa –

+0

working thanq @amit – vishwa

+0

私は自分のコードを投稿すると、 。@ Amit Vaghela – vishwa

関連する問題