2
나는 안드로이드에 대해 매우 익숙하며,이 문제를 해결하는 데 어려움이 있습니다. 성공적으로 내 응용 프로그램 내에서 바로 가기를 만들 수있었습니다. 유일한 문제는 바로 가기를 클릭 한 후에 어떤 일이 일어날지를 결정할 수 없다는 것입니다. MainActivity를 시작하기 만했으나 주요 활동이 선택되면 데이터를 전달하기를 원합니다. 여기 홈 화면의 바로 가기 실행 시작을 어떻게 설정할 수 있습니까? Android
Bundle extras = getIntent().getExtras();
내가 Mainfest이 무엇인지는 ... 여기에 ... 내가 무슨
Intent shortcutIntent = new Intent(getActivity().getApplicationContext(),
MainActivity.class);
shortcutIntent.setAction(Intent.ACTION_MAIN);
Intent addIntent = new Intent();
addIntent
.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, f.getName());
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
Intent.ShortcutIconResource.fromContext(getActivity().getApplicationContext(),
R.drawable.icon_folderbluegray));
addIntent.putExtra("info for Main Activity","Hello");
addIntent
.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
getActivity().getApplicationContext().sendBroadcast(addIntent);
입니다하지만이 작업을 수행 할 때, 내가 널 얻을.
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CREATE_SHORTCUT"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
브로드 캐스트 레코더는 어떻게 구현해야합니까? – user3195590
나는 대답을 – Android
편집하십시오 그래서 manifest는 수신기 꼬리표를 포함 할 는가 것입니다? – user3195590