<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/scr_levelboard"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".Survival" >
<ImageButton
android:id="@+id/btn_porch"
android:layout_width="100dip"
android:layout_height="40dip"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="36dp"
android:layout_marginTop="93dp"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/btn_porch"
android:onClick="LvlSelect"/>
<ImageButton
android:id="@+id/btn_livingroom"
android:layout_width="100dip"
android:layout_height="40dip"
android:layout_alignLeft="@+id/btn_porch"
android:layout_below="@+id/btn_porch"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/btn_livingroom"
android:onClick="LvlSelect"/>
<ImageButton
android:id="@+id/btnkitchen"
android:layout_width="100dip"
android:layout_height="40dip"
android:layout_alignLeft="@+id/btnbedroom"
android:layout_below="@+id/btnbedroom"
android:layout_marginTop="14dp"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/btn_kitchen"
android:onClick="LvlSelect"/>
<ImageButton
android:id="@+id/btnbedroom"
android:layout_width="100dip"
android:layout_height="40dip"
android:layout_alignLeft="@+id/btn_livingroom"
android:layout_below="@+id/btn_livingroom"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/btn_bedroom"
android:onClick="LvlSelect"/>
<ImageButton
android:id="@+id/btnwashroom"
android:layout_width="100dip"
android:layout_height="40dip"
android:layout_alignLeft="@+id/btnkitchen"
android:layout_below="@+id/btnkitchen"
android:layout_marginTop="18dp"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/btn_washroom"
android:onClick="LvlSelect"/>
<ImageButton
android:id="@+id/btnbasement"
android:layout_width="100dip"
android:layout_height="40dip"
android:layout_alignLeft="@+id/btnwashroom"
android:layout_below="@+id/btnwashroom"
android:background="@null"
android:scaleType="fitXY"
android:src="@drawable/btn_basement"
android:onClick="LvlSelect"/>
</RelativeLayout>
package com.example.thesis;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.app.Activity;
import android.content.Intent;
public class Survival extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_survival);
}
public void LvlSelect (View view){
if(view.getId()==R.id.btn_porch){
Intent d=new Intent(this, PorchStartactivity.class);
startActivity(d);}
else if(view.getId()==R.id.btn_livingroom){
Intent b=new Intent(this, LvroomStartactivity.class);
startActivity(b);
}
else if(view.getId()==R.id.btn_bdroom){
Intent c=new Intent(this, BdroomStartactivity.class);
startActivity(c);
}
}
}
package com.example.thesis;
import android.os.Bundle;
import android.view.Window;
import android.app.Activity;
import android.media.MediaPlayer;
public class PorchStartactivity extends Activity {
MediaPlayer bgmusic;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(new PorchGameView(this));
bgmusic = MediaPlayer.create(PorchStartactivity.this, R.raw.bgm_housefly);
bgmusic.setLooping(true);
bgmusic.start();
}
@Override
protected void onPause(){
super.onPause();
bgmusic.release();
finish();
}
}
01-15 22:24:11.428: E/AndroidRuntime(4170): FATAL EXCEPTION: main
01-15 22:24:11.428: E/AndroidRuntime(4170): java.lang.IllegalStateException: Could not execute method of the activity
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.view.View$1.onClick(View.java:3599)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.view.View.performClick(View.java:4204)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.view.View$PerformClick.run(View.java:17355)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.os.Handler.handleCallback(Handler.java:725)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.os.Handler.dispatchMessage(Handler.java:92)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.os.Looper.loop(Looper.java:137)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.app.ActivityThread.main(ActivityThread.java:5041)
01-15 22:24:11.428: E/AndroidRuntime(4170): at java.lang.reflect.Method.invokeNative(Native Method)
01-15 22:24:11.428: E/AndroidRuntime(4170): at java.lang.reflect.Method.invoke(Method.java:511)
01-15 22:24:11.428: E/AndroidRuntime(4170): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-15 22:24:11.428: E/AndroidRuntime(4170): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-15 22:24:11.428: E/AndroidRuntime(4170): at dalvik.system.NativeStart.main(Native Method)
01-15 22:24:11.428: E/AndroidRuntime(4170): Caused by: java.lang.reflect.InvocationTargetException
01-15 22:24:11.428: E/AndroidRuntime(4170): at java.lang.reflect.Method.invokeNative(Native Method)
01-15 22:24:11.428: E/AndroidRuntime(4170): at java.lang.reflect.Method.invoke(Method.java:511)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.view.View$1.onClick(View.java:3594)
01-15 22:24:11.428: E/AndroidRuntime(4170): ... 11 more
01-15 22:24:11.428: E/AndroidRuntime(4170): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.thesis/com.example.thesis.PorchStartactivity}; have you declared this activity in your AndroidManifest.xml?
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.app.Activity.startActivityForResult(Activity.java:3370)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.app.Activity.startActivityForResult(Activity.java:3331)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.app.Activity.startActivity(Activity.java:3566)
01-15 22:24:11.428: E/AndroidRuntime(4170): at android.app.Activity.startActivity(Activity.java:3534)
01-15 22:24:11.428: E/AndroidRuntime(4170): at com.example.thesis.Survival.LvlSelect(Survival.java:24)
01-15 22:24:11.428: E/AndroidRuntime(4170): ... 14 more
01-15 22:24:15.369: E/Trace(5617): error opening trace file: No such file or directory (2)
您的意图找不到“PorchStartActivity”类。
在androidmanifest中声明“porchstartactivity”活动
此外,其他活动(在您的情况下是级别)需要在应用程序清单文件中声明为活动。要了解更多为什么这很重要的信息,请阅读以下内容。
我是Android的初学者。我正在开发一个应用程序。我收到这个问题,我不知道怎么做。 这是我在logcat中收到的信息:
请在这方面需要帮助。当我试图在模拟器上运行我的应用程序时,我的Logcat中出现了这些错误,我的UI崩溃了 logcat错误
在v3 beta版SDK中,堆栈跟踪是: 病因是什么?
当我测试我的应用程序,我得到以下错误在Android StudioConsol: 我的密码是 家庭活动。JAVA 有人能帮忙吗?
我刚开始学习kotlin,我的第一个应用程序使用Retrifit2和Coroutine,但有问题。我有一些错误,但通过Coroutine,堆栈跟踪的信息非常少。也许有人会发现一个错误或知道hot使堆栈跟踪更有信息。 Apiservice:
我的代码在下面。它在Android Studio中给出了一个错误。任何人请帮帮我。我的PHP代码是可以的,但是为什么它会给出这个错误呢? register.java E/AndroidRuntime:致命异常:AsyncTask#1进程:com.example.SmTanverHossain.MyphpMysqlApplication,PID:5445 java.lang.RuntimeExcep