FakeLauncher

Android.mk

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-subdir-java-files)

LOCAL_PACKAGE_NAME := FakeLauncher
LOCAL_CERTIFICATE := shared
LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher2

include $(BUILD_PACKAGE)

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.bluebank.FakeLauncher">

    <application
        android:launchMode="singleTask"
        android:clearTaskOnLaunch="true"
        android:stateNotNeeded="true"
        android:resumeWhilePausing="true"
        android:windowSoftInputMode="adjustPan"
        android:screenOrientation="user">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>

</manifest>

MainActivity.java

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
    @Override
    protected void onResume() {
        super.onResume();
      try {
          Intent i = new Intent(Intent.ACTION_VIEW);
          i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
          String packageName = "cn.zhl.book";
          String className = "cn.zhl.activity.LoginActivity";
          i.setClassName(packageName, className);
          startActivity(i);
      } catch (Exception e) {
          e.printStackTrace();
          //Log.e(TAG, "BOOT_COMPLETED received start book exception");
      }
    }

    @Override
    public void onBackPressed() {
    }
}

results matching ""

    No results matching ""