gpt4 book ai didi

java - Android 异步 - 在 Android 中的 onPostExecute 中打开新 Activity ( Intent )

转载 作者:行者123 更新时间:2023-11-29 20:58:16 24 4
gpt4 key购买 nike

我有一个 Android 应用程序,它使用 MySQL 和 PHP 从服务器获取值。该应用程序工作正常,但在出现警报框后,它没有使用类文件 VoterLogin.java 重定向到下一个 Activity 。

这是代码,

@Override
protected void onPostExecute(String result) {
// ctx.startActivity(new Intent(ctx, VoterLogin.class));

if(result.equals("Registration Success..."))
{
Toast.makeText(ctx, result, Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(ctx, result, Toast.LENGTH_LONG).show();
alertDialog.setMessage(result);
alertDialog.show();
}
}

上面的代码 fragment 在 LogCat 中显示以下内容:

05-25 23:51:16.694 2214-2214/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<<br>
05-25 23:51:16.699 2214-2214/? D/AndroidRuntime: CheckJNI is ON<br>
05-25 23:51:16.726 2214-2214/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat<br>
05-25 23:51:16.761 2214-2214/? E/memtrack: Couldn't load memtrack module (No such file or directory)<br>
05-25 23:51:16.761 2214-2214/? E/android.os.Debug: failed to load memtrack module: -2<br>
05-25 23:51:16.763 2214-2214/? I/Radio-JNI: register_android_hardware_Radio DONE<br>
05-25 23:51:16.799 2214-2214/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm<br>
05-25 23:51:16.833 2059-2070/? D/DefContainer: Copying /data/local/tmp/amit.net.voteapplication to base.apk<br>
05-25 23:51:17.112 1300-1324/? I/PackageManager.DexOptimizer: Running dexopt (dex2oat) on: /data/app/vmdl1542992946.tmp/base.apk pkg=amit.net.voteapplication isa=x86 vmSafeMode=false debuggable=true oatDir = /data/app/vmdl1542992946.tmp/oat<br>
05-25 23:51:17.128 2223-2223/? W/dex2oat: Unexpected CPU variant for X86 using defaults: x86<br>
05-25 23:51:17.128 2223-2223/? W/dex2oat: Mismatch between dex2oat instruction set features (ISA: X86 Feature string: smp,-ssse3,-sse4.1,-sse4.2,-avx,-avx2) and those of dex2oat executable (ISA: X86 Feature string: smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2) for the command line:<br>
05-25 23:51:17.129 2223-2223/? W/dex2oat: /system/bin/dex2oat --zip-fd=6 --zip-location=base.apk --oat-fd=7 --oat-location=/data/app/vmdl1542992946.tmp/oat/x86/base.odex --instruction-set=x86 --instruction-set-variant=x86 --instruction-set-features=default --runtime-arg -Xms64m --runtime-arg -Xmx512m --swap-fd=8 --debuggable<br>
05-25 23:51:17.129 2223-2223/? I/dex2oat: /system/bin/dex2oat --debuggable<br>
05-25 23:51:17.250 2223-2223/? W/dex2oat: 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.ListView<br>
05-25 23:51:25.864 2223-2223/? I/dex2oat: dex2oat took 8.735s (threads: 1) arena alloc=515KB java alloc=2MB native alloc=9MB free=1788KB<br>
05-25 23:51:25.907 1300-1314/? I/ActivityManager: Force stopping amit.net.voteapplication appid=10072 user=-1: uninstall pkg<br>
05-25 23:51:25.907 1300-1314/? I/ActivityManager: Killing 2181:amit.net.voteapplication/u0a72 (adj 0): stop amit.net.voteapplication<br>
05-25 23:51:25.911 1300-1337/? W/InputDispatcher: channel 'b7ef2f3 amit.net.voteapplication/amit.net.voteapplication.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9<br>
05-25 23:51:25.911 1300-1337/? E/InputDispatcher: channel 'b7ef2f3 amit.net.voteapplication/amit.net.voteapplication.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!<br>
05-25 23:51:25.912 1300-1312/? D/GraphicsStats: Buffer count: 4<br>
05-25 23:51:25.912 1300-1312/? I/WindowState: WIN DEATH: Window{b7ef2f3 u0 amit.net.voteapplication/amit.net.voteapplication.MainActivity}<br>
05-25 23:51:25.913 1300-1312/? W/InputDispatcher: Attempted to unregister already unregistered input channel 'b7ef2f3 amit.net.voteapplication/amit.net.voteapplication.MainActivity (server)'<br>
05-25 23:51:25.951 1300-1314/? W/ActivityManager: Force removing ActivityRecord{4bc60b9 u0 amit.net.voteapplication/.MainActivity t505}: app died, no saved state<br>
05-25 23:51:26.008 1300-1324/? I/PackageManager: Package amit.net.voteapplication codePath changed from /data/app/amit.net.voteapplication-2 to /data/app/amit.net.voteapplication-1; Retaining data and using new<br>
05-25 23:51:26.009 1300-1324/? W/PackageManager: Code path for amit.net.voteapplication changing from /data/app/amit.net.voteapplication-2 to /data/app/amit.net.voteapplication-1<br>
05-25 23:51:26.009 1300-1324/? W/PackageManager: Resource path for amit.net.voteapplication changing from /data/app/amit.net.voteapplication-2 to /data/app/amit.net.voteapplication-1<br>
05-25 23:51:26.056 1300-1315/? W/art: Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService$MainHandler.handleMessage(android.os.Message) from ActivityManagerService.java:1698 waiters=0 for 149ms<br>
05-25 23:51:26.057 1300-1617/? W/art: Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService$MainHandler.handleMessage(android.os.Message) from ActivityManagerService.java:1698 waiters=1 for 145ms<br>
05-25 23:51:26.058 1300-1617/? W/ActivityManager: Spurious death for ProcessRecord{647ac55 0:amit.net.voteapplication/u0a72}, curProc for 2181: null<br>
05-25 23:51:26.062 1300-1314/? I/ActivityManager: Force stopping amit.net.voteapplication appid=10072 user=-1: replace pkg<br>
05-25 23:51:26.229 1300-1324/? W/Settings: Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.<br>
05-25 23:51:26.230 1300-1324/? I/art: Starting a blocking GC Explicit<br>
05-25 23:51:26.239 1542-1769/? W/EGL_emulation: eglSurfaceAttrib not implemented<br>
05-25 23:51:26.239 1542-1769/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa24b54e0, error=EGL_SUCCESS<br>
05-25 23:51:26.402 1300-1324/? I/art: Explicit concurrent mark sweep GC freed 28767(1684KB) AllocSpace objects, 12(320KB) LOS objects, 33% free, 5MB/8MB, paused 4.654ms total 160.940ms<br>
05-25 23:51:26.421 1300-1566/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 2181 uid 10072<br>
05-25 23:51:26.835 1300-1324/? W/PackageManager: Couldn't remove dex file for package: at location /data/app/amit.net.voteapplication-2/base.apk, retcode=-1<br>
05-25 23:51:26.850 2214-2214/? I/art: System.exit called, status: 0<br>
05-25 23:51:26.850 2214-2214/? I/AndroidRuntime: VM exiting with result code 0.<br>
05-25 23:51:26.870 1516-2136/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb4016980<br>
05-25 23:51:26.876 1300-1324/? I/ActivityManager: Force stopping amit.net.voteapplication appid=10072 user=0: pkg removed<br>
05-25 23:51:27.170 1300-1314/? W/art: Long monitor contention event with owner method=int com.android.server.am.ActivityManagerService.broadcastIntent(android.app.IApplicationThread, android.content.Intent, java.lang.String, android.content.IIntentReceiver, int, java.lang.String, android.os.Bundle, java.lang.String[], int, android.os.Bundle, boolean, boolean, int) from ActivityManagerService.java:16931 waiters=0 for 195ms
05-25 23:51:27.176 1300-1300/? D/JobSchedulerService: Receieved: android.intent.action.PACKAGE_REMOVED
05-25 23:51:27.187 1300-1338/? I/InputReader: Reconfiguring input devices. changes=0x00000010<br>
05-25 23:51:27.193 1536-1536/? D/CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_REMOVED<br>
05-25 23:51:27.194 1536-1536/? D/CarrierServiceBindHelper: mHandler: 3<br>
05-25 23:51:27.217 1940-1940/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1221 android.content.ContextWrapper.startService:581 android.content.ContextWrapper.startService:581 com.android.keychain.KeyChainBroadcastReceiver.onReceive:12 android.app.ActivityThread.handleReceiver:2725 <br>
05-25 23:51:27.320 1382-1393/? I/art: Background partial concurrent mark sweep GC freed 9677(427KB) AllocSpace objects, 0(0B) LOS objects, 39% free, 5MB/8MB, paused 25.484ms total 140.042ms<br>
05-25 23:51:27.821 2228-2228/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
05-25 23:51:27.823 2228-2228/? D/AndroidRuntime: CheckJNI is ON
05-25 23:51:27.833 2232-2232/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<<br>
05-25 23:51:27.835 2232-2232/? D/AndroidRuntime: CheckJNI is ON<br>
05-25 23:51:27.860 2228-2228/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat<br>
05-25 23:51:27.894 2228-2228/? E/memtrack: Couldn't load memtrack module (No such file or directory)<br>
05-25 23:51:27.894 2228-2228/? E/android.os.Debug: failed to load memtrack module: -2
05-25 23:51:27.896 2228-2228/? I/Radio-JNI: register_android_hardware_Radio DONE
05-25 23:51:27.898 2232-2232/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat<br>
05-25 23:51:27.934 2232-2232/? E/memtrack: Couldn't load memtrack module (No such file or directory)<br>
05-25 23:51:27.934 2232-2232/? E/android.os.Debug: failed to load memtrack module: -2<br>
05-25 23:51:27.936 2232-2232/? I/Radio-JNI: register_android_hardware_Radio DONE<br>
05-25 23:51:27.944 2228-2228/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm<br>
05-25 23:51:27.945 2228-2228/? D/AndroidRuntime: Shutting down VM<br>
05-25 23:51:27.968 2232-2232/? D/AndroidRuntime: Calling main entry com.android.commands.am.Am<br>
05-25 23:51:27.988 1516-1516/? I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.<br>
05-25 23:51:27.995 1300-1399/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=amit.net.voteapplication/.MainActivity} from uid 0 on display 0<br>
05-25 23:51:28.016 2232-2232/? D/AndroidRuntime: Shutting down VM<br>
05-25 23:51:28.032 1300-1338/? I/InputReader: Reconfiguring input devices. changes=0x00000010<br>
05-25 23:51:28.099 1300-1311/? I/ActivityManager: Start proc 2247:amit.net.voteapplication/u0a72 for activity amit.net.voteapplication/.MainActivity<br>
05-25 23:51:28.328 2247-2247/? I/art: Not late-enabling -Xcheck:jni (already on)<br>
05-25 23:51:28.372 1536-1536/? D/CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_ADDED<br>
05-25 23:51:28.374 1536-1536/? D/CarrierServiceBindHelper: mHandler: 3<br>
05-25 23:51:28.405 1542-1769/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb4014d10<br>
05-25 23:51:28.432 2247-2247/? W/System: ClassLoader referenced unknown path: /data/app/amit.net.voteapplication-1/lib/x86<br>
05-25 23:51:28.596 953-1336/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property<br>
05-25 23:51:28.597 2247-2260/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true<br>
05-25 23:51:28.721 2247-2260/? I/OpenGLRenderer: Initialized EGL, version 1.4<br>
05-25 23:51:28.740 1536-1536/? D/CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_REPLACED<br>
05-25 23:51:28.744 1536-1536/? D/CarrierServiceBindHelper: mHandler: 3<br>
05-25 23:51:28.745 1536-1536/? D/CarrierConfigLoader: mHandler: 9 phoneId: 0<br />
05-25 23:51:28.753 1300-1338/? I/InputReader: Reconfiguring input devices. changes=0x00000010<br>
05-25 23:51:28.788 2247-2260/? W/EGL_emulation: eglSurfaceAttrib not implemented<br>
05-25 23:51:28.788 2247-2260/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xabdc20c0, error=EGL_SUCCESS<br>
05-25 23:51:29.192 1300-1319/? I/ActivityManager: Displayed amit.net.voteapplication/.MainActivity: +1s117ms<br>
05-25 23:51:29.240 1516-1516/? I/LatinIME: Starting input. Cursor position = -1,-1<br>
05-25 23:51:29.240 1516-1516/? E/RichInputConnection: Unable to connect to the editor to retrieve text.<br>
05-25 23:51:29.240 1516-1516/? D/RichInputConnection: Will try to retrieve text later.<br>
05-25 23:51:29.240 1516-1516/? I/InputAttributes: InputType.TYPE_NULL is specified<br>
05-25 23:51:29.246 1516-1516/? I/LatinIME: Starting input. Cursor position = 0,0<br>
05-25 23:51:29.399 1300-1313/? W/VoiceInteractionManagerService: no available voice recognition services found for user 0<br>
05-25 23:51:29.473 1516-2136/? W/EGL_emulation: eglSurfaceAttrib not implemented<br>
05-25 23:51:29.473 1516-2136/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xabebbac0, error=EGL_SUCCESS<br>
05-25 23:51:51.019 2247-2260/? W/EGL_emulation: eglSurfaceAttrib not implemented<br>
05-25 23:51:51.019 2247-2260/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xabdc2d20, error=EGL_SUCCESS<br>
05-25 23:51:51.289 2247-2260/? W/EGL_emulation: eglSurfaceAttrib not implemented<br>
05-25 23:51:51.289 2247-2260/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xabdfece0, error=EGL_SUCCESS<br>
05-25 23:51:54.372 2247-2260/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xab794ca0<br>
05-25 23:51:56.204 2247-2260/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xab794d10<br>
05-25 23:51:56.210 2247-2247/? W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.<br>
05-25 23:51:56.212 1300-1311/? W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4ab1e93 attribute=null, token = android.os.BinderProxy@85a4ab3<br>

我已经尝试了 StackOverflow 中的一些操作,但没有一个能正常工作,并且单击按钮后的结果是“不幸的是,VoteApplication 已停止”。在这里,我还列出了我尝试过的 3 个代码 fragment ,

以下是代码1:

        #1
Intent intent_name = new Intent();
intent_name.setClass(ctx.getApplicationContext(), VoterLogin.class);
ctx.startActivity(intent_name);

以下是代码2:

        #2
ctx.startActivity(new Intent(ctx, VoterLogin.class));

#2 显示“不幸的错误”,并显示以下 LogCat:

05-26 00:30:12.063 2586-2586/? E/memtrack: Couldn't load memtrack module (No such file or directory)
05-26 00:30:12.063 2586-2586/? E/android.os.Debug: failed to load memtrack module: -2
05-26 00:30:20.747 2604-2604/? E/memtrack: Couldn't load memtrack module (No such file or directory)
05-26 00:30:20.747 2604-2604/? E/android.os.Debug: failed to load memtrack module: -2
05-26 00:30:20.844 2602-2602/? E/memtrack: Couldn't load memtrack module (No such file or directory)
05-26 00:30:20.844 2602-2602/? E/android.os.Debug: failed to load memtrack module: -2
05-26 00:30:21.381 1542-1769/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa30c7df0
05-26 00:30:21.414 953-987/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
05-26 00:30:22.235 1516-1516/? E/RichInputConnection: Unable to connect to the editor to retrieve text.
05-26 00:30:28.926 2617-2617/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: amit.net.voteapplication, PID: 2617
android.content.ActivityNotFoundException: Unable to find explicit activity class {amit.net.voteapplication/amit.net.voteapplication.VoterLogin}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1794)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
at android.app.Activity.startActivityForResult(Activity.java:3917)
at android.app.Activity.startActivityForResult(Activity.java:3877)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:784)
at android.app.Activity.startActivity(Activity.java:4200)
at android.app.Activity.startActivity(Activity.java:4168)
at amit.net.voteapplication.BackgroundTask.onPostExecute(BackgroundTask.java:146)
at amit.net.voteapplication.BackgroundTask.onPostExecute(BackgroundTask.java:30)
at android.os.AsyncTask.finish(AsyncTask.java:651)
at android.os.AsyncTask.-wrap1(AsyncTask.java)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
05-26 00:30:28.971 953-953/? E/EGL_emulation: tid 953: eglCreateSyncKHR(1294): error 0x3004 (EGL_BAD_ATTRIBUTE)
05-26 00:30:31.445 1300-1337/? E/InputDispatcher: channel '29ddb2b amit.net.voteapplication/amit.net.voteapplication.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
05-26 00:30:31.505 1300-2145/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa1b8b8b0
05-26 00:30:31.507 1300-1337/? E/InputDispatcher: channel '28520cd !Password! (server)' ~ Channel is unrecoverably broken and will be disposed!
05-26 00:30:31.641 1516-2136/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb4016980

以下是代码3:

        #3
Intent login = new Intent(ctx, VoterLogin.class);
login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
ctx.startActivity(login);
((Activity) ctx).finish();

#3 显示“不幸的错误”,并显示以下 LogCat:

05-26 00:25:06.735 953-2137/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
05-26 00:25:07.391 1542-1769/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa31f75e0
05-26 00:25:07.795 1516-1516/? E/RichInputConnection: Unable to connect to the editor to retrieve text.
05-26 00:25:11.350 2551-2551/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: amit.net.voteapplication, PID: 2551
android.content.ActivityNotFoundException: Unable to find explicit activity class {amit.net.voteapplication/amit.net.voteapplication.VoterLogin}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1794)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
at android.app.Activity.startActivityForResult(Activity.java:3917)
at android.app.Activity.startActivityForResult(Activity.java:3877)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:784)
at android.app.Activity.startActivity(Activity.java:4200)
at android.app.Activity.startActivity(Activity.java:4168)
at amit.net.voteapplication.BackgroundTask.onPostExecute(BackgroundTask.java:148)
at amit.net.voteapplication.BackgroundTask.onPostExecute(BackgroundTask.java:30)
at android.os.AsyncTask.finish(AsyncTask.java:651)
at android.os.AsyncTask.-wrap1(AsyncTask.java)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
05-26 00:25:11.384 953-953/? E/EGL_emulation: tid 953: eglCreateSyncKHR(1294): error 0x3004 (EGL_BAD_ATTRIBUTE)
05-26 00:25:13.569 1300-1337/? E/InputDispatcher: channel 'f478103 amit.net.voteapplication/amit.net.voteapplication.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
05-26 00:25:13.580 1300-1337/? E/InputDispatcher: channel '9098762 !Password! (server)' ~ Channel is unrecoverably broken and will be disposed!
05-26 00:25:13.611 1300-2145/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa1b8b990
05-26 00:25:13.945 1516-2136/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb40168a0

因此,LogCat 中可见异常 -

ActivityNotFoundException: Unable to find explicit activity class {amit.net.voteapplication/amit.net.voteapplication.VoterLogin}

这是我的 list ,请让我知道问题,

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="amit.net.voteapplication"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="23" />

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name="amit.net.voteapplication.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

最佳答案

android.content.ActivityNotFoundException: Unable to find explicit activity class {amit.net.voteapplication/amit.net.voteapplication.VoterLogin}; have you declared this activity in your AndroidManifest.xml?

我认为您忘记在 list 中声明该 Activity 。

关于java - Android 异步 - 在 Android 中的 onPostExecute 中打开新 Activity ( Intent ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37444616/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com