launcher

对于android.intent.action.MAIN和android.intent.category.LAUNCHER的理解

两盒软妹~` 提交于 2020-01-21 05:35:54
当我们使用Android Studio创建一个工程并生成一个Activity时,经常可以在清单文件中看到如下的代码: <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 如果我们创建第二个Activity的话,标签里面默是没有action和category的,那么这里的android.intent.action.MAIN和android.intent.category.LAUNCHER有什么作用呢? 通过查阅API文档,了解到它们的作用如下: android.intent.action.MAIN:决定应用的入口Activity,也就是我们启动应用时首先显示哪一个Activity。 android.intent.category.LAUNCHER:表示activity应该被列入系统的启动器(launcher)(允许用户启动它)。Launcher是安卓系统中的桌面启动器,是桌面UI的统称。 action和category都是Intent的组成部分

Android更改桌面应用程序launcher的两种方式

天涯浪子 提交于 2020-01-19 05:57:12
launcher ,也就是 android 的桌面应用程序。下图是 我正在使用的魅族手机 的 launcher 应用程序: 接下来我们要开发一个自己的 launcher ,使其替代系统的默认 launcher 。 怎样使我们的应用程序成为一个 launcher ? 首先我们要有一个自己的Android应用,在这里,我使用最简单的应用程序Hello, 使用eclipse创建Android项目我这里就省略了,直接上图 来看看我的 AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.hello" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name"

类加载器详解

大憨熊 提交于 2020-01-18 12:03:48
  类加载器是负责将可能是网络上、也可能是磁盘上的class文件加载到内存中。并为其生成对应的java.lang.class对象。一旦一个类被载入JVM了,同一个类就不会被再次加载。那么怎样才算是同一个类?在JAVA中一个类用其全限定类名(包名和类名)作为其唯一标识,但是在JVM中,一个类用其全限定类名和其类加载器作为其唯一标识。也就是说,在JAVA中的同一个类,如果用不同的类加载器加载,则生成的class对象认为是不同的。   当JVM启动时,会形成由三个类加载器组成的初始类加载器层次结构 1、启动类加载器BootstrapClassLoader: 是嵌在JVM内核中的加载器,该加载器是用C++语言写的,主要负载加载JAVA_HOME/lib下的类库,启动类加载器无法被应用程序直接使用。 2、扩展类加载器Extension ClassLoader: 该加载器器是用JAVA编写,且它的父类加载器是Bootstrap,是由sun.misc.Launcher$ExtClassLoader实现的,主要加载JAVA_HOME/lib/ext目录中的类库。开发者可以这几使用扩展类加载器。   我们知道java中系统属性java.ext.dirs指定的目录由ExtClassLoader加载器加载,如果程序中没有指定该系统属性(-Djava.ext.dirs=sss/lib)那么该加载器默认加载

Unable to launch default home screen from a list of all launchers

耗尽温柔 提交于 2020-01-17 11:01:48
问题 I am trying to get the list of all available launchers on my phone. Clicking on particular launcher from the list should make it a default Home screen launcher. On clicking the default phone launchers (TouchWiz Home in Samsung), the app stops unfortunately (but returns to the home screen which was set earlier). I could only open the third party launchers but it is not being set as the default home screen, and on clicking the home button it goes back to the previous home screen. The code is as

Unable to launch default home screen from a list of all launchers

眉间皱痕 提交于 2020-01-17 11:01:45
问题 I am trying to get the list of all available launchers on my phone. Clicking on particular launcher from the list should make it a default Home screen launcher. On clicking the default phone launchers (TouchWiz Home in Samsung), the app stops unfortunately (but returns to the home screen which was set earlier). I could only open the third party launchers but it is not being set as the default home screen, and on clicking the home button it goes back to the previous home screen. The code is as

Create a shortcut for APK in the Homescreen

ⅰ亾dé卋堺 提交于 2020-01-17 04:30:10
问题 I have a compiled APK and My workaround to make a shortcut at the home screen is : 1- Decode the apk with apktool.jar 2- Modify AndroidManifest (add the <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> ) 3- Recompile the apk and put it in the system.img 4- with yaffey tool i replaced the file and calculate the CRC. After flashing the smartphone the shortcut is not created on the Homescreen? is there any way to place the shortcut for preinstalled APK ?

什么时候加上android.intent.category.DEFAULT和LAUNCHER

删除回忆录丶 提交于 2020-01-16 07:42:40
转自:http://blog.csdn.net/ccccdddxxx/article/details/7843070 1、要弄清楚这个问题,首先需要弄明白什么是implicit(隐藏) intent什么是explicit(明确) intent。 Explicit Intent明确的指定了要启动的Acitivity ,比如以下Java代码: Intent intent= new Intent(this, B.class) Implicit Intent没有明确的指定要启动哪个Activity ,而是通过设置一些Intent Filter来让系统去筛选合适的Acitivity去启动。 2、intent到底发给哪个activity,需要进行三个匹配,一个是action,一个是category,一个是data。 理论上来说,如果intent不指定category,那么无论intent filter的内容是什么都应该是匹配的。但是,如果是implicit intent,android默认给加上一个CATEGORY_DEFAULT,这样的话如果intent filter中没有android.intent.category.DEFAULT这个category的话,匹配测试就会失败。所以,如果你的 activity支持接收implicit intent的话就一定要在intent

launch exe with params, but program closes instantly after opening?

此生再无相见时 提交于 2020-01-16 03:29:27
问题 I am writing a client for my gaming community and one of the functions of this client is to launch a game via the client with parameters that will enable our community mod pack on launch. When I press the button, the game begins to launch and as soon as the program opens (the icon pops up in the task bar), it closes instantly. Is there something I am missing that is needed to keep the launched exe running? Here is my code: private void btnLaunchGame_Click(object sender, EventArgs e) { string

Wait for all child processes of a ran process to finish C#

社会主义新天地 提交于 2020-01-16 01:27:10
问题 I'm developing a Launcher application for games. Much like XBOX Dashboard in XNA. I want to open back my program when the process which it started(the game) exits. With a simple game this is working: [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetForegroundWindow(IntPtr hWnd); [DllImportAttribute("User32.DLL")] private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); private const int SW_SHOW = 5; private const int SW_MINIMIZE = 6; private