해결책을 찾았습니다.
<?xml version="1.0" encoding="UTF-8"?>
<favorites>
<favorite package="com.android.email" class="com.android.email.activity.Welcome"/>
<favorite package="com.android.browser" class="com.android.browser.BrowserActivity"/>
</favorites>
을 그리고 샘플 코드, 내가 방법 "bindFavorites을"편집 (내가 사용하는 XML 파일을로드 :
나는 "자산"을 작성 폴더에있는 파일 "favorites.xml"를 생성
/**
* Refreshes the favorite applications stacked over the all apps button.
* The number of favorites depends on the user.
*/
private void bindFavorites(boolean isLaunching) {
if (!isLaunching || mFavorites == null) {
if (mFavorites == null) {
mFavorites = new LinkedList<ApplicationInfo>();
} else {
mFavorites.clear();
}
InputStream is = null;
try {
is = getAssets().open("favorites.xml");
} catch (IOException e) {
Log.e(LOG_TAG, "Couldn't find or open favorites file ");
return;
}
final Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
final PackageManager packageManager = getPackageManager();
try {
final XmlPullParser parser = Xml.newPullParser();
parser.setInput(is, "UTF-8");
beginDocument(parser, TAG_FAVORITES);
ApplicationInfo application;
while (true) {
nextElement(parser);
String name = parser.getName();
if (!TAG_FAVORITE.equals(name)) {
break;
}
final String favoritePackage = parser.getAttributeValue(null, TAG_PACKAGE);
final String favoriteClass = parser.getAttributeValue(null, TAG_CLASS);
final ComponentName cn = new ComponentName(favoritePackage, favoriteClass);
intent.setComponent(cn);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
application = getApplicationInfo(packageManager, intent);
if (application != null) {
application.intent = intent;
mFavorites.addFirst(application);
}
}
} catch (XmlPullParserException e) {
Log.w(LOG_TAG, "Got exception parsing favorites.", e);
} catch (IOException e) {
Log.w(LOG_TAG, "Got exception parsing favorites.", e);
}
}
mApplicationsStack.setFavorites(mFavorites);
}
을 그리고 그것은 작동하지만 난 여전히 xml 파일에 우리는 클래스 값을 설정해야하고 내가이 정보를 찾을 수있는 곳 모르겠어, 도움이 필요 : 대신) FileReader와의의 InputStream. 보시다시피,이 값은 응용 프로그램에 따라 다릅니다. 여기에 몇 가지 값을 발견 : http://forum.xda-developers.com/showthread.php?t=836719 하지만 내 자신의 티타늄 애플 리케이션과 나는 어떤 클래스 값이 필요하지 모르겠다.
다시 게시글을 잊어 버리고 원하는 모든 것을 찾았습니다. 이것이 자신의 응용 프로그램이라면 쉽습니다. 와 같이 packageName "com.example.yourApp"와 className "MainActivity"만 있으면됩니다. –
Aximem