开发者

android application force close on this.startactivity(intent);

this is the source code i am using

@Override public boolean onOptionsItemSelected(MenuItem item) { 
        switch (item.getItemId()) {
        case R.id.AndroidLogo: 开发者_开发问答
            Intent intent = new Intent(this, AddUser.class);
          this.startActivity(intent);
        break;
        case R.id.AndroidText: 
            Intent intent2 = new Intent(this, SearchUser.class);
              this.startActivity(intent2);
        break;
        } 
        return true; 
        }


I think you have not mentioned the classes in menifest you wanted to call ;Use these permission lines to call another activity in activity tag

 < android:enabled="true" android:name="AddUser"/> 

for one first and for second class use another activity tag

<android:enabled="true" android:name="SearchUser"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜