<activity
android:name="com.layout.LayoutActivity"
android:label="V-Alert Registration" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
调用作为主要活动的LayoutActivity
这是我用来调用布局活动的代码(主要活动),它显示未找到活动
if(i>=1)
{
Toast.makeText(FiveActivity.this,"You Registerd already with one mail\n Delete the mail and Register with new mail",Toast.LENGTH_LONG).show();
try{
Intent obj=new Intent("com.layout.LayoutActivity");
startActivity(obj);}
catch(Exception e)
{
Toast.makeText(FiveActivity.this,e.toString(),Toast.LENGTH_LONG).show();
}
}
答案 0 :(得分:4)
Intent obj=new Intent(FiveActivity.this,LayoutActivity.class);
startActivity(obj);
finish();
答案 1 :(得分:1)
在你的程序中使用:
Intent obj = new Intent();
obj.setClassName("com.layout.LayoutActivity"); // Are you sure?? this is your class package name
startActivity(obj);
答案 2 :(得分:0)
试试这个: -
if(i>=1)
{
Toast.makeText(FiveActivity.this,"You Registerd already with one mail\n Delete the mail and Register with new mail",Toast.LENGTH_LONG).show();
try{
Intent obj=new Intent(FiveActivity.this,LayoutActivity.class);
startActivity(obj);}
catch(Exception e)
{
Toast.makeText(FiveActivity.this,e.toString(),Toast.LENGTH_LONG).show();
}
}
答案 3 :(得分:0)
您可以这样打电话:这会再次调用您的特定活动。
Intent i = getIntent();
finish();
startActivity(i);
答案 4 :(得分:0)
通过此更改您的清单...
<activity
android:name="com.layout.LayoutActivity"
android:label="V-Alert Registration" >
</activity>
然后开始你的LayoutActivity ......
if(i>=1){
Toast.makeText(FiveActivity.this,"You Registerd already with one mail\n Delete the mail
and Register with new mail",Toast.LENGTH_LONG).show();
try{
Intent obj=new Intent(FiveActivity.this, LayoutActivity.class);
startActivity(obj);
}catch(Exception e) {
Toast.makeText(FiveActivity.this,e.toString(),Toast.LENGTH_LONG).show();
}
}
}