android 页面跳转代码
生活随笔
收集整理的這篇文章主要介紹了
android 页面跳转代码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?Activity跳轉頁面代碼
Intent intent = new Intent();
intent.setClass(MainActivity.this, activity_second.class);
startActivity(intent);
其中?activity_second為要跳轉的頁面
要在AndroidManifest.xml寫activity,不然會報錯
例如?<activity
? ? ? ? ? ? android:name="com.example.reportform.activity_second"
? ? ? ? ? ? android:label="@string/app_name" >
? ? ? ? ? ? >
? ? ? ? ? ??
? ? ? ? </activity>
其中?"com.example.reportform.activity_second" 為包名.activity類名
總結
以上是生活随笔為你收集整理的android 页面跳转代码的全部內容,希望文章能夠幫你解決所遇到的問題。