java.lang.IllegalStateException:无法执行与Android活动的方法 [英] java.lang.IllegalStateException: Could not execute method of the activity with Android
问题描述
我是一个相当新的Android程序员,并通过一对夫妇的辅导工作后,我就开始于BMI计算器教程中我完成了扩大。在这个过程中,它成了我有必要删除并重新安装Eclipse。我也不得不切换工作区。由于我犯的一个错误,我只能保留.java文件的应用程序。我重新创建的.xml和明显,只是现在我得到了IllegalStateException异常,当我尝试点击计算按钮。切换和重建之前,一切都运行得很好。我使用的Nexus银河的模拟器,运行4.2.2这里的code:
包com.example.bmicalculator;
进口android.app.Activity;进口android.os.Bundle;进口
android.view.Menu;进口android.view.View;进口
android.widget.EditText;进口android.widget.ImageView;进口
android.widget.TextView;
公共类MainActivity扩展活动{ImageDownloader
下载;@覆盖
保护无效的onCreate(捆绑savedInstanceState){
super.onCreate(savedInstanceState);
的setContentView(R.layout.activity_main);}公共无效calculateClickHandler(查看视图){
如果(view.getId()== R.id.calculateButton){
的EditText weightText =(EditText上)findViewById(R.id.weightLabel);
的EditText heightText =(EditText上)findViewById(R.id.heightText);
TextView的resultText =(的TextView)findViewById(R.id.resultLabel);
TextView的suggestText =(的TextView)findViewById(R.id.suggestedFix);
ImageView的图像=(ImageView的)findViewById(R.id.relatedPicture);
浮体重= Float.parseFloat(weightText.getText()的toString());
浮高度= Float.parseFloat(heightText.getText()的toString()); 浮bmiValue = calculateBMI(体重,身高); 字符串bmiInter pretation =间pretBMI(bmiValue); 字符串建议=建议+间pretBMIInter pretation(bmiInter pretation); resultText.setText(bmiValue + - + bmiInter pretation);
suggestText.setText(建议)
setUpImage(图像,bmiInter pretation);
}
}私人浮动calculateBMI(浮点体重,身高浮动){
回报(浮)(权重* 4.88 /(身高×高));
}私人字符串间pretBMI(浮动bmiValue){
如果(bmiValue< 16){
返回严重不足;
}否则如果(bmiValue< 18.5){
返回减持;
}否则如果(bmiValueα25){
回到正常;
}
否则如果(bmiValue小于30){
返回增持;
}
其他{
返回肥胖;
}
}
@覆盖
公共布尔onCreateOptionsMenu(菜单菜单){
//充气菜单;如果是present这增加了项目操作栏。
。getMenuInflater()膨胀(R.menu.main,菜单);
返回true;
}私人字符串间pretBMIInter pretation(字符串插值){
如果(interp.equals(严重不足)){
返回吃多了,您仍然可以锻炼身体,保持身材苗条,但你需要更多的重量。
}
否则,如果(interp.equals(减持)){
返回吃多了一点,一起锻炼增加肌肉的重量。
}
否则如果(interp.equals(正常)){
返回继续尽一切是你做的。
}
否则,如果(interp.equals(增持)){
返回工作了一点点失去一些脂肪poinds并把一些肌肉磅,你会成为一个健康的体重。
}
其他{
返回削减你的食物摄入量和工作了一点点走一段很长的路要走。
}
}私人无效setUpImage(ImageView的图像,字符串插值){
如果(interp.equals(严重不足)){
image.setVisibility(View.INVISIBLE);
下载=新ImageDownloader(图片);
字符串URL = \"http://www.wendys.com/cs/Satellite?blobcol=urldata&blobheader=image%2Fpng&blobkey=id&blobtable=MungoBlobs&blobwhere=1365660287009&ssbinary=true\";
downloader.execute(URL);
}
否则,如果(interp.equals(减持)){
image.setVisibility(View.INVISIBLE);
下载=新ImageDownloader(图片);
字符串URL =http://www.livestrongfitness.com/blog/wp-content/uploads/barbell.jpg;
downloader.execute(URL);
}
否则如果(interp.equals(正常)){
image.setVisibility(View.INVISIBLE);
下载=新ImageDownloader(图片);
字符串URL =http://primary3.tv/blog/wp-content/uploads/2011/03/thumbsup.jpg;
downloader.execute(URL);
}
否则,如果(interp.equals(增持)){
image.setVisibility(View.INVISIBLE);
下载=新ImageDownloader(图片);
字符串URL =http://www.livestrongfitness.com/blog/wp-content/uploads/barbell.jpg;
downloader.execute(URL);
}
其他{
image.setVisibility(View.INVISIBLE);
下载=新ImageDownloader(图片);
字符串URL =http://wisefitnesstips.com/wp-content/uploads/2013/02/salad-nutrients-facts.jpg;
downloader.execute(URL);
}
}
}
块引用>而ImageDownload类:
包com.example.bmicalculator;
进口的java.io.InputStream;进口的java.net.URL;
进口android.graphics.Bitmap;进口android.graphics.BitmapFactory;
进口android.os.AsyncTask;进口android.view.View;进口
android.widget.ImageView;公共类ImageDownloader扩展
AsyncTask的{
ImageView的形象;公共ImageDownloader(ImageView的图像){this.image =图像;
}受保护的位图doInBackground(串...字符串){
尝试{
位图位图= BitmapFactory.de codeStream((InputStream的新的网址字符串[0])的getContent());
返回位图; }赶上(例外五){
的System.out.println(错误:+ E);
返回null; }
}保护无效onProgressUpdate(整数...进度){}保护无效onPostExecute(位图结果){
image.setImageBitmap(结果);
image.setVisibility(View.VISIBLE);
}}
块引用>而LogCat中:
14 05-23:45:52.447:E / AndroidRuntime(1083):致命异常:主要
05-23 14:45:52.447:E / AndroidRuntime(1083):
java.lang.IllegalStateException:无法执行的方法
活动05-23 14:45:52.447:E / AndroidRuntime(1083):在
android.view.View $ 1.onClick(View.java:3599)05-23 14:45:52.447:
E / AndroidRuntime(1083):在
android.view.View.performClick(View.java:4204)05-23 14:45:52.447:
E / AndroidRuntime(1083):在
android.view.View $ PerformClick.run(View.java:17355)05-23
14:45:52.447:E / AndroidRuntime(1083):在
android.os.Handler.handleCallback(Handler.java:725)05-23
14:45:52.447:E / AndroidRuntime(1083):在
android.os.Handler.dispatchMessage(Handler.java:92)05-23
14:45:52.447:E / AndroidRuntime(1083):在
android.os.Looper.loop(Looper.java:137)05-23 14:45:52.447:
E / AndroidRuntime(1083):在
android.app.ActivityThread.main(ActivityThread.java:5041)05-23
14:45:52.447:E / AndroidRuntime(1083):在
java.lang.reflect.Method.invokeNative(本机方法)05-23
14:45:52.447:E / AndroidRuntime(1083):在
java.lang.reflect.Method.invoke(Method.java:511)05-23 14:45:52.447:
E / AndroidRuntime(1083):在
com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:793)
05-23 14:45:52.447:E / AndroidRuntime(1083):在
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)05-23
14:45:52.447:E / AndroidRuntime(1083):在
dalvik.system.NativeStart.main(本机方法)05-23 14:45:52.447:
E / AndroidRuntime(1083):因:
java.lang.reflect.InvocationTargetException 05-23 14:45:52.447:
E / AndroidRuntime(1083):在
java.lang.reflect.Method.invokeNative(本机方法)05-23
14:45:52.447:E / AndroidRuntime(1083):在
java.lang.reflect.Method.invoke(Method.java:511)05-23 14:45:52.447:
E / AndroidRuntime(1083):在
android.view.View $ 1.onClick(View.java:3594)05-23 14:45:52.447:
E / AndroidRuntime(1083):11 ...更多05-23 14:45:52.447:
E / AndroidRuntime(1083):java.lang.ClassCastException:产生的原因:
android.widget.TextView不能转换为android.widget.EditText
05-23 14:45:52.447:E / AndroidRuntime(1083):在
com.example.bmicalculator.MainActivity.calculateClickHandler(MainActivity.java:23)
05-23 14:45:52.447:E / AndroidRuntime(1083):14 ...更多05-23
14:47:48.527:D / dalvikvm(1158):GC_CONCURRENT释放55K,7%免费
2770K / 2948K,暂停6ms的14ms的+,共有96ms 05-23 14:47:48.877:
D / gralloc_goldfish(1158):无仿真模拟GPU检测。
05-23 14:47:53.837:D / InputEventConsistencyVerifier(1158):KeyEvent的:
ACTION_UP但关键是不下来。 05-23 14:47:53.837:
D / InputEventConsistencyVerifier(1158):在
android.widget.EditText {40d2d8e8 VFED..CL .F ....我。 32,209-452,288
7f080003应用:ID / heightText} 05-23 14:47:53.837:D / InputEventConsistencyVerifier(1158):0:9223.01亿发,
{的KeyEvent行动= ACTION_UP,关键code = KEY code_TAB,扫描code = 15,
亚状态= 0,旗帜= 0x8中,的repeatCount = 0,EVENTTIME = 922301,
停机时间= 922168,DEVICEID = 0,源= 0x101} 05-23 14:47:55.097:
D / AndroidRuntime(1158):关闭VM 05-23 14:47:55.097:
W / dalvikvm(1158):主题ID = 1:螺纹未捕获的异常退出
(组= 0x40a71930)05-23 14:47:55.187:E / AndroidRuntime(1158):FATAL
例外:主要05-23 14:47:55.187:E / AndroidRuntime(1158):
java.lang.IllegalStateException:无法执行的方法
活动05-23 14:47:55.187:E / AndroidRuntime(1158):在
android.view.View $ 1.onClick(View.java:3599)05-23 14:47:55.187:
E / AndroidRuntime(1158):在
android.view.View.performClick(View.java:4204)05-23 14:47:55.187:
E / AndroidRuntime(1158):在
android.view.View $ PerformClick.run(View.java:17355)05-23
14:47:55.187:E / AndroidRuntime(1158):在
android.os.Handler.handleCallback(Handler.java:725)05-23
14:47:55.187:E / AndroidRuntime(1158):在
android.os.Handler.dispatchMessage(Handler.java:92)05-23
14:47:55.187:E / AndroidRuntime(1158):在
android.os.Looper.loop(Looper.java:137)05-23 14:47:55.187:
E / AndroidRuntime(1158):在
android.app.ActivityThread.main(ActivityThread.java:5041)05-23
14:47:55.187:E / AndroidRuntime(1158):在
java.lang.reflect.Method.invokeNative(本机方法)05-23
14:47:55.187:E / AndroidRuntime(1158):在
java.lang.reflect.Method.invoke(Method.java:511)05-23 14:47:55.187:
E / AndroidRuntime(1158):在
com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:793)
05-23 14:47:55.187:E / AndroidRuntime(1158):在
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)05-23
14:47:55.187:E / AndroidRuntime(1158):在
dalvik.system.NativeStart.main(本机方法)05-23 14:47:55.187:
E / AndroidRuntime(1158):因:
java.lang.reflect.InvocationTargetException 05-23 14:47:55.187:
E / AndroidRuntime(1158):在
java.lang.reflect.Method.invokeNative(本机方法)05-23
14:47:55.187:E / AndroidRuntime(1158):在
java.lang.reflect.Method.invoke(Method.java:511)05-23 14:47:55.187:
E / AndroidRuntime(1158):在
android.view.View $ 1.onClick(View.java:3594)05-23 14:47:55.187:
E / AndroidRuntime(1158):11 ...更多05-23 14:47:55.187:
E / AndroidRuntime(1158):java.lang.ClassCastException:产生的原因:
android.widget.TextView不能转换为android.widget.EditText
05-23 14:47:55.187:E / AndroidRuntime(1158):在
com.example.bmicalculator.MainActivity.calculateClickHandler(MainActivity.java:23)
05-23 14:47:55.187:E / AndroidRuntime(1158):14 ...更多05-23
14:47:57.797:I /流程(1158):发送信号。 PID:1158 SIG:9
块引用>我确信,用于参考的所有ID是正确的。该应用程序似乎已建成,就像它以前我感动过的一切。
解决方案产生的原因:java.lang.ClassCastException:android.widget.TextView不能转换到android.widget.EditText 05 -23 14:45:52.447:E / AndroidRuntime(1083):在 的EditText weightText =(EditText上)findViewById(R.id.weightLabel);
的EditText heightText =(EditText上)findViewById(R.id.heightText);一个来自
weightText
和heightText
是的TextView
。I'm a fairly new Android programmer, and after working through a couple of tutorials I began expanding upon the BMI Calculator tutorial I completed. During this process, it became necessary for me to delete and re-install Eclipse. I also had to switch workspaces. Due to a mistake on my part, I was only able to retain the .java files for the app. I recreated the .xml and manifest, only now I'm getting the IllegalStateException when I try to click the calculate button. Before switching over and recreating, everything ran fine. I'm using an emulator of the Nexus Galaxy, running 4.2.2 Here's the code:
package com.example.bmicalculator;
import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView;
public class MainActivity extends Activity { ImageDownloader downloader;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void calculateClickHandler(View view) { if(view.getId() == R.id.calculateButton) { EditText weightText = (EditText)findViewById(R.id.weightLabel); EditText heightText = (EditText)findViewById(R.id.heightText); TextView resultText = (TextView)findViewById(R.id.resultLabel); TextView suggestText= (TextView)findViewById(R.id.suggestedFix); ImageView image = (ImageView)findViewById(R.id.relatedPicture); float weight = Float.parseFloat(weightText.getText().toString()); float height = Float.parseFloat(heightText.getText().toString()); float bmiValue = calculateBMI(weight, height); String bmiInterpretation = interpretBMI(bmiValue); String suggest = "We suggest " + interpretBMIInterpretation(bmiInterpretation); resultText.setText(bmiValue + "-" + bmiInterpretation); suggestText.setText(suggest); setUpImage(image, bmiInterpretation); } } private float calculateBMI(float weight, float height) { return (float) (weight * 4.88 / (height * height)); } private String interpretBMI(float bmiValue) { if(bmiValue < 16) { return "Severely underweight"; } else if (bmiValue < 18.5) { return "Underweight"; } else if(bmiValue < 25) { return "Normal"; } else if(bmiValue < 30) { return "Overweight"; } else { return "Obese"; } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } private String interpretBMIInterpretation(String interp) { if(interp.equals("Severely underweight")) { return "eating more. You can still work out and stay thin, but you need more weight."; } else if(interp.equals("Underweight")) { return "eating a little more, alongside working out to gain muscle weight."; } else if(interp.equals("Normal")) { return "continuing to do whatever it is you're doing."; } else if(interp.equals("Overweight")) { return "working out a little. Lose a few fat poinds and put on some muscle pounds, and you'll be a healthy weight."; } else { return "cutting back on your food intake and working out. A little goes a long way."; } } private void setUpImage(ImageView image, String interp) { if(interp.equals("Severely underweight")) { image.setVisibility(View.INVISIBLE); downloader = new ImageDownloader(image); String url = "http://www.wendys.com/cs/Satellite?blobcol=urldata&blobheader=image%2Fpng&blobkey=id&blobtable=MungoBlobs&blobwhere=1365660287009&ssbinary=true"; downloader.execute(url); } else if(interp.equals("Underweight")) { image.setVisibility(View.INVISIBLE); downloader = new ImageDownloader(image); String url = "http://www.livestrongfitness.com/blog/wp-content/uploads/barbell.jpg"; downloader.execute(url); } else if(interp.equals("Normal")) { image.setVisibility(View.INVISIBLE); downloader = new ImageDownloader(image); String url = "http://primary3.tv/blog/wp-content/uploads/2011/03/thumbsup.jpg"; downloader.execute(url); } else if(interp.equals("Overweight")) { image.setVisibility(View.INVISIBLE); downloader = new ImageDownloader(image); String url = "http://www.livestrongfitness.com/blog/wp-content/uploads/barbell.jpg"; downloader.execute(url); } else { image.setVisibility(View.INVISIBLE); downloader = new ImageDownloader(image); String url = "http://wisefitnesstips.com/wp-content/uploads/2013/02/salad-nutrients-facts.jpg"; downloader.execute(url); } } }
And the ImageDownload Class:
package com.example.bmicalculator;
import java.io.InputStream; import java.net.URL;
import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.AsyncTask; import android.view.View; import android.widget.ImageView; public class ImageDownloader extends AsyncTask { ImageView image; public ImageDownloader(ImageView image) { this.image = image; } protected Bitmap doInBackground(String... strings) { try { Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(strings[0]).getContent()); return bitmap; } catch (Exception e) { System.out.println("Error: " + e); return null; } }
protected void onProgressUpdate(Integer... progress) { } protected void onPostExecute(Bitmap result) { image.setImageBitmap(result); image.setVisibility(View.VISIBLE); } }
And the LogCat:
05-23 14:45:52.447: E/AndroidRuntime(1083): FATAL EXCEPTION: main 05-23 14:45:52.447: E/AndroidRuntime(1083): java.lang.IllegalStateException: Could not execute method of the activity 05-23 14:45:52.447: E/AndroidRuntime(1083): at android.view.View$1.onClick(View.java:3599) 05-23 14:45:52.447: E/AndroidRuntime(1083): at android.view.View.performClick(View.java:4204) 05-23 14:45:52.447: E/AndroidRuntime(1083): at android.view.View$PerformClick.run(View.java:17355) 05-23 14:45:52.447: E/AndroidRuntime(1083): at android.os.Handler.handleCallback(Handler.java:725) 05-23 14:45:52.447: E/AndroidRuntime(1083): at android.os.Handler.dispatchMessage(Handler.java:92) 05-23 14:45:52.447: E/AndroidRuntime(1083): at android.os.Looper.loop(Looper.java:137) 05-23 14:45:52.447: E/AndroidRuntime(1083): at android.app.ActivityThread.main(ActivityThread.java:5041) 05-23 14:45:52.447: E/AndroidRuntime(1083): at java.lang.reflect.Method.invokeNative(Native Method) 05-23 14:45:52.447: E/AndroidRuntime(1083): at java.lang.reflect.Method.invoke(Method.java:511) 05-23 14:45:52.447: E/AndroidRuntime(1083): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 05-23 14:45:52.447: E/AndroidRuntime(1083): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 05-23 14:45:52.447: E/AndroidRuntime(1083): at dalvik.system.NativeStart.main(Native Method) 05-23 14:45:52.447: E/AndroidRuntime(1083): Caused by: java.lang.reflect.InvocationTargetException 05-23 14:45:52.447: E/AndroidRuntime(1083): at java.lang.reflect.Method.invokeNative(Native Method) 05-23 14:45:52.447: E/AndroidRuntime(1083): at java.lang.reflect.Method.invoke(Method.java:511) 05-23 14:45:52.447: E/AndroidRuntime(1083): at android.view.View$1.onClick(View.java:3594) 05-23 14:45:52.447: E/AndroidRuntime(1083): ... 11 more 05-23 14:45:52.447: E/AndroidRuntime(1083): Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText 05-23 14:45:52.447: E/AndroidRuntime(1083): at com.example.bmicalculator.MainActivity.calculateClickHandler(MainActivity.java:23) 05-23 14:45:52.447: E/AndroidRuntime(1083): ... 14 more 05-23 14:47:48.527: D/dalvikvm(1158): GC_CONCURRENT freed 55K, 7% free 2770K/2948K, paused 6ms+14ms, total 96ms 05-23 14:47:48.877: D/gralloc_goldfish(1158): Emulator without GPU emulation detected. 05-23 14:47:53.837: D/InputEventConsistencyVerifier(1158): KeyEvent: ACTION_UP but key was not down. 05-23 14:47:53.837: D/InputEventConsistencyVerifier(1158): in android.widget.EditText{40d2d8e8 VFED..CL .F....I. 32,209-452,288
7f080003 app:id/heightText} 05-23 14:47:53.837: D/InputEventConsistencyVerifier(1158): 0: sent at 922301000000,
KeyEvent { action=ACTION_UP, keyCode=KEYCODE_TAB, scanCode=15, metaState=0, flags=0x8, repeatCount=0, eventTime=922301, downTime=922168, deviceId=0, source=0x101 } 05-23 14:47:55.097: D/AndroidRuntime(1158): Shutting down VM 05-23 14:47:55.097: W/dalvikvm(1158): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 05-23 14:47:55.187: E/AndroidRuntime(1158): FATAL EXCEPTION: main 05-23 14:47:55.187: E/AndroidRuntime(1158): java.lang.IllegalStateException: Could not execute method of the activity 05-23 14:47:55.187: E/AndroidRuntime(1158): at android.view.View$1.onClick(View.java:3599) 05-23 14:47:55.187: E/AndroidRuntime(1158): at android.view.View.performClick(View.java:4204) 05-23 14:47:55.187: E/AndroidRuntime(1158): at android.view.View$PerformClick.run(View.java:17355) 05-23 14:47:55.187: E/AndroidRuntime(1158): at android.os.Handler.handleCallback(Handler.java:725) 05-23 14:47:55.187: E/AndroidRuntime(1158): at android.os.Handler.dispatchMessage(Handler.java:92) 05-23 14:47:55.187: E/AndroidRuntime(1158): at android.os.Looper.loop(Looper.java:137) 05-23 14:47:55.187: E/AndroidRuntime(1158): at android.app.ActivityThread.main(ActivityThread.java:5041) 05-23 14:47:55.187: E/AndroidRuntime(1158): at java.lang.reflect.Method.invokeNative(Native Method) 05-23 14:47:55.187: E/AndroidRuntime(1158): at java.lang.reflect.Method.invoke(Method.java:511) 05-23 14:47:55.187: E/AndroidRuntime(1158): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 05-23 14:47:55.187: E/AndroidRuntime(1158): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 05-23 14:47:55.187: E/AndroidRuntime(1158): at dalvik.system.NativeStart.main(Native Method) 05-23 14:47:55.187: E/AndroidRuntime(1158): Caused by: java.lang.reflect.InvocationTargetException 05-23 14:47:55.187: E/AndroidRuntime(1158): at java.lang.reflect.Method.invokeNative(Native Method) 05-23 14:47:55.187: E/AndroidRuntime(1158): at java.lang.reflect.Method.invoke(Method.java:511) 05-23 14:47:55.187: E/AndroidRuntime(1158): at android.view.View$1.onClick(View.java:3594) 05-23 14:47:55.187: E/AndroidRuntime(1158): ... 11 more 05-23 14:47:55.187: E/AndroidRuntime(1158): Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText 05-23 14:47:55.187: E/AndroidRuntime(1158): at com.example.bmicalculator.MainActivity.calculateClickHandler(MainActivity.java:23) 05-23 14:47:55.187: E/AndroidRuntime(1158): ... 14 more 05-23 14:47:57.797: I/Process(1158): Sending signal. PID: 1158 SIG: 9
I've made sure that all ids used for reference are correct. The app appears to have been built just like it was before I moved everything over.
解决方案Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText 05-23 14:45:52.447: E/AndroidRuntime(1083): at EditText weightText = (EditText)findViewById(R.id.weightLabel); EditText heightText = (EditText)findViewById(R.id.heightText);
one from
weightText
andheightText
is aTextView
.这篇关于java.lang.IllegalStateException:无法执行与Android活动的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!