我创建闪屏正常工作时安装APK第一次,但是当我 关闭我的应用程序,然后重新启动则显示错误“应用程序未安装”当我在Android监视器检查则显示“ getServiceInstance失败!“错误我不知道该做什么好心帮助我。闪屏错误
这是我的闪屏代码:
package com.example.kamran.ebloodbank;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashScreen extends Activity {
/** Duration of wait **/
private final int SPLASH_DISPLAY_LENGTH = 3000;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.splash_screen);
/* New Handler to start the Menu-Activity
* and close this Splash-Screen after some seconds.*/
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
/* Create an Intent that will start the Menu-Activity. */
Intent mainIntent = new Intent(SplashScreen.this,MainActivity.class);
SplashScreen.this.startActivity(mainIntent);
SplashScreen.this.finish();
}
}, SPLASH_DISPLAY_LENGTH);
}
}
这是AndroidManifest代码:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.kamran.ebloodbank">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".SplashScreen"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="E Blood Bank"
android:screenOrientation="portrait"/>
<activity
android:name=".LogIn"
android:label="@string/loghead"
android:screenOrientation="portrait"/>
<activity
android:name=".RegisterForm"
android:label="Registration Form"
android:screenOrientation="portrait"/>
<activity
android:name=".FindDonor"
android:label="Find Donor"
android:screenOrientation="portrait"/>
<activity
android:name=".FindBloodBank"
android:label="Find Blood Bank"
android:screenOrientation="portrait"/>
<activity android:name=".GuestActivity"
android:screenOrientation="portrait"/>
<activity android:name=".AfterLoginMain"
android:screenOrientation="portrait"/>
<activity android:name=".ViewProfile"
android:label="View Profile"
android:screenOrientation="portrait"></activity>
</application>
</manifest>
这是logcat的:
03-02 16:43:34.783 18763-18763/? I/art: Late-enabling -Xcheck:jni
03-02 16:43:34.801 18763-18774/? I/art: Debugger is no longer active
03-02 16:43:34.827 18763-18763/? W/System: ClassLoader referenced unknown path: /data/app/com.example.kamran.ebloodbank-2/lib/arm64
03-02 16:43:34.828 18763-18763/? D/ActivityThread: BIND_APPLICATION handled : 0/AppBindData{appInfo=ApplicationInfo{f88c761 com.example.kamran.ebloodbank clone=false}}
03-02 16:43:34.828 18763-18763/? V/ActivityThread: Handling launch of ActivityRecord{2a286 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}} startsNotResumed=false
03-02 16:43:34.863 18763-18763/? V/ActivityThread: ActivityRecord{2a286 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}}: [email protected], appName=com.example.kamran.ebloodbank, pkg=com.example.kamran.ebloodbank, comp={com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}, dir=/data/app/com.example.kamran.ebloodbank-2/base.apk
03-02 16:43:34.885 18763-18763/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
03-02 16:43:34.925 18763-18763/? E/MultiWindowProxy: getServiceInstance failed!
03-02 16:43:35.058 18763-18777/? I/System: FinalizerDaemon: finalize objects = 1
03-02 16:43:35.176 18763-18763/? V/ActivityThread: Performing resume of ActivityRecord{2a286 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}}
03-02 16:43:35.181 18763-18763/? D/ActivityThread: ACT-AM_ON_RESUME_CALLED ActivityRecord{2a286 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}}
03-02 16:43:35.181 18763-18763/? V/ActivityThread: Resume ActivityRecord{2a286 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}} started activity: false, hideForNow: false, finished: false
03-02 16:43:35.181 18763-18763/? V/PhoneWindow: DecorView setVisiblity: visibility = 4 ,Parent =null, this =com.android.internal.policy.PhoneWindow$DecorView{715693c I.E...... R.....ID 0,0-0,0}
03-02 16:43:35.190 18763-18763/? D/WindowClient: Add to mViews: com.android.internal.policy.PhoneWindow$DecorView{715693c I.E...... R.....ID 0,0-0,0}, this = [email protected]
03-02 16:43:35.192 18763-18763/? D/OpenGLRenderer: Dumper init 4 threads <0x7fab7284c0>
03-02 16:43:35.192 18763-18763/? D/OpenGLRenderer: <com.example.kamran.ebloodbank> is running.
03-02 16:43:35.198 18763-18800/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: false
03-02 16:43:35.198 18763-18800/? D/OpenGLRenderer: CanvasContext() 0x7fab99c000
03-02 16:43:35.214 18763-18763/? I/[MALI][Gralloc]: [+]r_hnd(0x7fad0e6ac0), client(29), share_fd(28)
03-02 16:43:35.214 18763-18763/? D/GraphicBuffer: register, handle(0x7fad0e6ac0) (w:1856 h:2048 s:1856 f:0x1 u:0x000100)
03-02 16:43:35.216 18763-18763/? D/ViewRootImpl: hardware acceleration is enabled, this = ViewRoot{cea581a com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen,ident = 0}
03-02 16:43:35.222 18763-18763/? V/ActivityThread: Resuming ActivityRecord{2a286 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}} with isForward=true
03-02 16:43:35.222 18763-18763/? V/PhoneWindow: DecorView setVisiblity: visibility = 0 ,Parent =ViewRoot{cea581a com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen,ident = 0}, this =com.android.internal.policy.PhoneWindow$DecorView{715693c V.E...... R.....ID 0,0-0,0}
03-02 16:43:35.222 18763-18763/? V/ActivityThread: Scheduling idle handler for ActivityRecord{2a286 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}}
03-02 16:43:35.223 18763-18763/? D/ActivityThread: ACT-LAUNCH_ACTIVITY handled : 0/ActivityRecord{2a286 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}}
03-02 16:43:35.248 18763-18800/? D/OpenGLRenderer: CanvasContext() 0x7fab99c000 initialize window=0x7facf1f010, title=com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen
03-02 16:43:35.248 18763-18763/? D/Surface: Surface::allocateBuffers(this=0x7facf1f000)
03-02 16:43:35.256 18763-18800/? I/OpenGLRenderer: Initialized EGL, version 1.4
03-02 16:43:35.263 18763-18800/? D/OpenGLRenderer: Created EGL context (0x7fa6d11580)
03-02 16:43:35.267 18763-18800/? I/OpenGLRenderer: Get enable program binary service property (1)
03-02 16:43:35.267 18763-18800/? I/OpenGLRenderer: Initializing program atlas...
03-02 16:43:35.268 18763-18800/? D/ProgramBinary/Service: BpProgramBinaryService.getFileDescriptor
03-02 16:43:35.270 18763-18800/? D/ProgramBinary/Service: BpProgramBinaryService.getProgramMapLen
03-02 16:43:35.270 18763-18800/? D/ProgramBinary/Service: BpProgramBinaryService.getProgramMapArray
03-02 16:43:35.271 18763-18800/? D/ProgramBinary/Service: BpProgramBinaryService.getProgramBinaryLen
03-02 16:43:35.271 18763-18800/? I/OpenGLRenderer: Program binary detail: Binary length is 169616, program map length is 152.
03-02 16:43:35.272 18763-18800/? I/OpenGLRenderer: Succeeded to mmap program binaries. File descriptor is 36, and path is /dev/ashmem�.
03-02 16:43:35.272 18763-18800/? I/OpenGLRenderer: No need to use file discriptor anymore, close fd(36).
03-02 16:43:35.273 18763-18800/? D/OpenGLRenderer: Initializing program cache from 0x7fb09eabc8, size = 5
03-02 16:43:35.278 18763-18800/? D/OpenGLRenderer: -- init (key = 0x0000000000000000)
03-02 16:43:35.280 18763-18800/? D/OpenGLRenderer: -- init (key = 0x0000000000000001)
03-02 16:43:35.284 18763-18800/? D/OpenGLRenderer: -- init (key = 0x0000000800000003)
03-02 16:43:35.287 18763-18800/? D/OpenGLRenderer: -- init (key = 0x0000001000000000)
03-02 16:43:35.289 18763-18800/? D/OpenGLRenderer: -- init (key = 0x0000003800000000)
03-02 16:43:35.294 18763-18800/? W/libEGL: [ANDROID_RECORDABLE] format: 1
03-02 16:43:35.297 18763-18800/? D/mali_winsys: new_window_surface returns 0x3000
03-02 16:43:35.309 18763-18763/? V/InputMethodManager: onWindowFocus: null softInputMode=288 first=true flags=#81810100
03-02 16:43:35.310 18763-18763/? V/InputMethodManager: START INPUT: com.android.internal.policy.PhoneWindow$DecorView{715693c V.E...... R.....ID 0,0-1080,1920} ic=null [email protected] controlFlags=#104
03-02 16:43:35.390 18763-18800/? D/OpenGLRenderer: CacheTexture 4 upload: x, y, width height = 0, 0, 481, 439
03-02 16:43:35.396 18763-18800/? I/[MALI][Gralloc]: [+]r_hnd(0x7fa6d2ddc0), client(29), share_fd(38)
03-02 16:43:35.396 18763-18800/? D/GraphicBuffer: register, handle(0x7fa6d2ddc0) (w:1080 h:1920 s:1088 f:0x1 u:0x000b00)
03-02 16:43:35.400 18763-18800/? D/OpenGLRenderer: ProgramCache save to disk, size = 5
03-02 16:43:38.190 18763-18763/com.example.kamran.ebloodbank D/ActivityThread: ACT-AM_ON_PAUSE_CALLED ActivityRecord{2a286 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.SplashScreen}}
03-02 16:43:38.198 18763-18763/com.example.kamran.ebloodbank D/ActivityThread: ACT-PAUSE_ACTIVITY handled : 1/[email protected]
03-02 16:43:38.199 18763-18763/com.example.kamran.ebloodbank V/ActivityThread: Handling launch of ActivityRecord{f752940 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}} startsNotResumed=false
03-02 16:43:38.199 18763-18763/com.example.kamran.ebloodbank V/ActivityThread: ActivityRecord{f752940 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}}: [email protected], appName=com.example.kamran.ebloodbank, pkg=com.example.kamran.ebloodbank, comp={com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}, dir=/data/app/com.example.kamran.ebloodbank-2/base.apk
03-02 16:43:38.207 18763-18763/com.example.kamran.ebloodbank E/MultiWindowProxy: getServiceInstance failed!
03-02 16:43:38.249 18763-18763/com.example.kamran.ebloodbank V/ActivityThread: Performing resume of ActivityRecord{f752940 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}}
03-02 16:43:38.250 18763-18763/com.example.kamran.ebloodbank D/ActivityThread: ACT-AM_ON_RESUME_CALLED ActivityRecord{f752940 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}}
03-02 16:43:38.250 18763-18763/com.example.kamran.ebloodbank V/ActivityThread: Resume ActivityRecord{f752940 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}} started activity: false, hideForNow: false, finished: false
03-02 16:43:38.250 18763-18763/com.example.kamran.ebloodbank V/PhoneWindow: DecorView setVisiblity: visibility = 4 ,Parent =null, this =com.android.internal.policy.PhoneWindow$DecorView{eee47a0 I.E...... R.....ID 0,0-0,0}
03-02 16:43:38.251 18763-18763/com.example.kamran.ebloodbank D/WindowClient: Add to mViews: com.android.internal.policy.PhoneWindow$DecorView{eee47a0 I.E...... R.....ID 0,0-0,0}, this = [email protected]
03-02 16:43:38.253 18763-18800/com.example.kamran.ebloodbank D/OpenGLRenderer: CanvasContext() 0x7fab9a3000
03-02 16:43:38.254 18763-18763/com.example.kamran.ebloodbank D/ViewRootImpl: hardware acceleration is enabled, this = ViewRoot{b076f59 com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity,ident = 1}
03-02 16:43:38.259 18763-18763/com.example.kamran.ebloodbank V/ActivityThread: Resuming ActivityRecord{f752940 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}} with isForward=true
03-02 16:43:38.260 18763-18763/com.example.kamran.ebloodbank V/PhoneWindow: DecorView setVisiblity: visibility = 0 ,Parent =ViewRoot{b076f59 com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity,ident = 1}, this =com.android.internal.policy.PhoneWindow$DecorView{eee47a0 V.E...... R.....ID 0,0-0,0}
03-02 16:43:38.260 18763-18763/com.example.kamran.ebloodbank V/ActivityThread: Scheduling idle handler for ActivityRecord{f752940 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}}
03-02 16:43:38.261 18763-18763/com.example.kamran.ebloodbank D/ActivityThread: ACT-LAUNCH_ACTIVITY handled : 0/ActivityRecord{f752940 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}}
03-02 16:43:38.297 18763-18800/com.example.kamran.ebloodbank D/OpenGLRenderer: CanvasContext() 0x7fab9a3000 initialize window=0x7facf20c10, title=com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity
03-02 16:43:38.297 18763-18763/com.example.kamran.ebloodbank D/Surface: Surface::allocateBuffers(this=0x7facf20c00)
03-02 16:43:38.298 18763-18800/com.example.kamran.ebloodbank W/libEGL: [ANDROID_RECORDABLE] format: 1
03-02 16:43:38.300 18763-18800/com.example.kamran.ebloodbank D/mali_winsys: new_window_surface returns 0x3000
03-02 16:43:38.328 18763-18800/com.example.kamran.ebloodbank D/OpenGLRenderer: CacheTexture 4 upload: x, y, width height = 68, 0, 468, 437
03-02 16:43:38.335 18763-18800/com.example.kamran.ebloodbank I/[MALI][Gralloc]: [+]r_hnd(0x7fa6d2e4a0), client(29), share_fd(42)
03-02 16:43:38.335 18763-18800/com.example.kamran.ebloodbank D/GraphicBuffer: register, handle(0x7fa6d2e4a0) (w:1080 h:1920 s:1088 f:0x1 u:0x000b00)
03-02 16:43:38.406 18763-18763/com.example.kamran.ebloodbank V/InputMethodManager: onWindowFocus: null softInputMode=288 first=true flags=#81810100
03-02 16:43:38.407 18763-18763/com.example.kamran.ebloodbank V/InputMethodManager: START INPUT: com.android.internal.policy.PhoneWindow$DecorView{eee47a0 V.E...... R.....ID 0,0-1080,1920} ic=null [email protected] controlFlags=#104
03-02 16:43:38.437 18763-18800/com.example.kamran.ebloodbank I/[MALI][Gralloc]: [+]r_hnd(0x7fa6d2e5e0), client(29), share_fd(41)
03-02 16:43:38.437 18763-18800/com.example.kamran.ebloodbank D/GraphicBuffer: register, handle(0x7fa6d2e5e0) (w:1080 h:1920 s:1088 f:0x1 u:0x000b00)
03-02 16:43:38.467 18763-18800/com.example.kamran.ebloodbank D/GraphicBuffer: unregister, handle(0x7fa6d2ddc0) (w:1080 h:1920 s:1088 f:0x1 u:0x000b00)
03-02 16:43:38.469 18763-18800/com.example.kamran.ebloodbank I/[MALI][Gralloc]: [-]r_hnd(0x7fa6d2ddc0), client(29), share_fd(38)
03-02 16:43:38.822 18763-18763/com.example.kamran.ebloodbank D/WindowClient: Remove from mViews: com.android.internal.policy.PhoneWindow$DecorView{715693c V.E...... R......D 0,0-1080,1920}, this = [email protected]
03-02 16:43:38.822 18763-18763/com.example.kamran.ebloodbank D/ActivityThread: ACT-DESTROY_ACTIVITY handled : 1/[email protected]
03-02 16:43:39.835 18763-18763/com.example.kamran.ebloodbank D/ActivityThread: ACT-AM_ON_PAUSE_CALLED ActivityRecord{f752940 [email protected] {com.example.kamran.ebloodbank/com.example.kamran.ebloodbank.MainActivity}}
03-02 16:43:39.854 18763-18763/com.example.kamran.ebloodbank D/ActivityThread: ACT-PAUSE_ACTIVITY_FINISHING handled : 0/[email protected]
03-02 16:43:39.935 18763-18800/com.example.kamran.ebloodbank D/GraphicBuffer: unregister, handle(0x7fa6d2e4a0) (w:1080 h:1920 s:1088 f:0x1 u:0x000b00)
03-02 16:43:39.937 18763-18800/com.example.kamran.ebloodbank I/[MALI][Gralloc]: [-]r_hnd(0x7fa6d2e4a0), client(29), share_fd(42)
03-02 16:43:39.938 18763-18800/com.example.kamran.ebloodbank D/GraphicBuffer: unregister, handle(0x7fa6d2e5e0) (w:1080 h:1920 s:1088 f:0x1 u:0x000b00)
03-02 16:43:39.939 18763-18800/com.example.kamran.ebloodbank I/[MALI][Gralloc]: [-]r_hnd(0x7fa6d2e5e0), client(29), share_fd(41)
03-02 16:43:39.954 18763-18763/com.example.kamran.ebloodbank D/WindowClient: Remove from mViews: com.android.internal.policy.PhoneWindow$DecorView{eee47a0 V.E...... R......D 0,0-1080,1920}, this = [email protected]
03-02 16:43:39.954 18763-18763/com.example.kamran.ebloodbank D/ActivityThread: ACT-DESTROY_ACTIVITY handled : 1/[email protected]
03-02 16:43:44.886 18763-18800/com.example.kamran.ebloodbank D/OpenGLRenderer: ~CanvasContext() 0x7fab99c000
03-02 16:43:44.889 18763-18800/com.example.kamran.ebloodbank D/OpenGLRenderer: ~CanvasContext() 0x7fab9a3000
显示您的logcat请 –
它不会显示在logcat的 –
无效缓存任何错误,并重新启动...尝试 –