第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

實(shí)現(xiàn)點(diǎn)擊一個(gè)界面上的按鈕彈出另一個(gè)界面,另一個(gè)界面以對話框形式顯示

實(shí)現(xiàn)點(diǎn)擊一個(gè)界面上的按鈕彈出另一個(gè)界面,另一個(gè)界面以對話框形式顯示

慕桂英2234914 2017-07-31 16:41:26
<activity android:name=".FirstActivity"> ? ?<intent-filter> ? ? ? ?<action android:name="android.intent.action.MAIN" /> ? ? ? ?<category android:name="android.intent.category.LAUNCHER" /> ? ?</intent-filter></activity><activity ? ?android:name=".SecondActivity" ? ?android:theme="@android:style/Theme.DeviceDefault.Dialog" ? ?/>btn1.setOnClickListener(new View.OnClickListener(){ ? ?@Override ? ?public void onClick(View view) { ? ? ? ?Intent intent = new Intent(FirstActivity.this,SecondActivity.class); ? ? ? ?FirstActivity.this.startActivity(intent); ? ?}});報(bào)錯(cuò):07-31 16:38:59.871 7159-7159/com.example.form.myformcomponent I/locat: 執(zhí)行了--------------onCreate()方法07-31 16:38:59.991 7159-7159/com.example.form.myformcomponent I/locat: 執(zhí)行了--------------onStart()方法07-31 16:39:00.001 7159-7159/com.example.form.myformcomponent I/locat: 執(zhí)行了--------------onResume()方法07-31 16:39:00.131 7159-7218/com.example.form.myformcomponent I/OpenGLRenderer: Initialized EGL, version 1.407-31 16:39:00.151 7159-7159/com.example.form.myformcomponent W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView07-31 16:39:03.921 7159-7159/com.example.form.myformcomponent I/locat: 執(zhí)行了--------------onPause()方法07-31 16:39:03.931 7159-7159/com.example.form.myformcomponent E/AndroidRuntime: FATAL EXCEPTION: mainProcess: com.example.form.myformcomponent, PID: 7159java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.form.myformcomponent/com.example.form.myformcomponent.SecondActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2586)at android.app.ActivityThread.access$900(ActivityThread.java:163)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1462)at android.os.Handler.dispatchMessage(Handler.java:102)at android.os.Looper.loop(Looper.java:135)at android.app.ActivityThread.main(ActivityThread.java:5574)at java.lang.reflect.Method.invoke(Native Method)at java.lang.reflect.Method.invoke(Method.java:372)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:962)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:356)at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:325)at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:286)at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)at com.example.form.myformcomponent.SecondActivity.onCreate(SecondActivity.java:12)at android.app.Activity.performCreate(Activity.java:6084)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2472)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2586) at android.app.ActivityThread.access$900(ActivityThread.java:163) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1462) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5574) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:962) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757) 07-31 16:39:03.961 7159-7159/com.example.form.myformcomponent I/Process: Sending signal. PID: 7159 SIG: 9
查看完整描述

1 回答

?
蜂之谷

TA貢獻(xiàn)564條經(jīng)驗(yàn) 獲得超863個(gè)贊

<activity
???android:name=".SecondActivity"
???android:theme="@style/Theme.AppCompat.Dialog"
???/>

錯(cuò)誤不是提示了嗎,改下主題就好了

查看完整回答
反對 回復(fù) 2017-07-31
  • 慕桂英2234914
    慕桂英2234914
    嗯,看到了,為什么在eclipse里的主題在android studio就不能用了?
  • 蜂之谷
    蜂之谷
    都可以用啊,關(guān)鍵看你activity繼承的什么,貌似eclipse繼承的Activity,android studio繼承的AppCompatActivity
  • 1 回答
  • 0 關(guān)注
  • 4244 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號