We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
轉換頁面有兩種方式,一種是切換Activity,一種是切換layout。
切換layout的方式很簡單,就是把目前的View切換成另一個View(應該吧XD)
setContentView(R.layout.another_layout);
使用Intent來切換。
Intent
Intent intent = new Intent(MainActivity.this,AnotherActivity.class); startActivity(intent);
在這裡,我照著上述寫了但是每次按下切換,還是直接閃退,於是參考了本篇文末文章。
解決方式 : 打開manifests資料夾中的AndroidManifest.xml檔案,在<application></application>之間,加入一個新的<activity></activity>,範例如下 :
manifests
AndroidManifest.xml
<application></application>
<activity></activity>
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.AppName"> //...(other activities)... <activity android:name=".AnotherActivity" android:label="@string/app_name" android:theme="@style/Theme.AppName.NoActionBar" android:exported="true"> </activity> </application>
reference : yunshuipiao/Potato#64
The text was updated successfully, but these errors were encountered:
No branches or pull requests
轉換頁面
轉換頁面有兩種方式,一種是切換Activity,一種是切換layout。
切換layout
切換layout的方式很簡單,就是把目前的View切換成另一個View(應該吧XD)
切換Activity
使用
Intent
來切換。在這裡,我照著上述寫了但是每次按下切換,還是直接閃退,於是參考了本篇文末文章。
解決方式 :
打開
manifests
資料夾中的AndroidManifest.xml
檔案,在<application></application>
之間,加入一個新的<activity></activity>
,範例如下 :The text was updated successfully, but these errors were encountered: