歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Android實現界面跳轉

Android實現界面跳轉

日期:2017/3/1 10:02:30   编辑:Linux編程

Android實現界面跳轉的代碼如下:

第一種:

Intent mIntent = new Intent();
mIntent.setClassName(mcureeActivity.this, nextActivity.class);
startActivity(mIntent)

第二種:

Intent mIntent = new Intent();
mIntent.setClassName("com.android.test", "com.android.test.next");
startActivity(mIntent);


第三種:設置可以通過setResult()返回值給nextActivity

Intent mIntent = new Intent(mcureeActivity.this, nextActivity.class);
setResult(NUMBER,mIntent);
mcureeActivity.this.finish();

更多Android相關信息見Android 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=11

Copyright © Linux教程網 All Rights Reserved