1

In my app i want to download another app from play store and when download complete,i want to cheack refferar of that app.

below my code in manifest

<receiver
        android:name="com.example.demornd.Receiver"
        android:exported="true" >
        <intent-filter>
            <action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>

             </intent-filter>
    </receiver>

and in my activity

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + appPackageName + "&referrer="
                + "hello"))); 

and my receiver

public class Receiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent arg1) {
    Bundle extras = arg1.getExtras();
    String referrerString = extras.getString("url");
    Log.w("TEST", "Referrer is: " + referrerString);
    Toast.makeText(context, "Application Download Sucessfully", Toast.LENGTH_LONG).show();
}

}

but my broadcast is never get called . please help! how to solve this problem

thanks in advance.

0 Answers0