Android start activity on Menu Item selection

蹲街弑〆低调 提交于 2019-11-30 09:08:49
Balaji Khadake

You can use like this and don't forget to add both activities to AndroidManifest.xml:

Intent launchNewIntent = new Intent(CurrentClass.this,SecondClass.class);
startActivityForResult(launchNewIntent, 0);

Have you tried this way?

Intent intent = new Intent(Main.this, Map.class);
case R.id.home:
    startActivity(new Intent(main.this, map.class));
    return true;

You have to implement this line into your Manifest

<uses-library android:name="com.google.android.maps" />

If you did this already you did it wrong! It has to be within the <application> </application> tag. Otherwise you will get your error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!