アプリがデバイスにインストールされ、成功した後。私はそのアプリパッケージ名を取得しなければならないし、パッケージ名から "アプリ名"を特定しなければならない。どのように私は行うことができますアンドロイドでアプリケーション名を取得する方法は?
コード: - :Googleドキュメントのによると
<receiver android:name=".apps.AppListener">
<intent-filter android:priority="100">
<action android:name="android.intent.action.PACKAGE_INSTALL"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
:
マニフェストでprivate String TAG = CAppReceiver.class.getSimpleName();
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals("android.intent.action.PACKAGE_ADDED")){
Log.d(TAG,"App package::" + intent.getData().toString());
}
}
あなたはPackageManager経由で試しましたか? – EpicPandaForce
[アプリのインストール時にブロードキャストを受信する](http://stackoverflow.com/questions/11246326/how-to-receiving-broadcast-when-application-install-or-removed)[パッケージ名からアプリケーション名を取得]を参照してくださいhttp://stackoverflow.com/questions/5841161/get-application-name-from-package-name) – Omer
http://stackoverflow.com/questions/7090883/how-can-i-get-package-name-in -android – saiRam89