1

I am having an ImageView,on click of that I want to download an apk from google play store ,without passing intent to google play store.You can see the code below which I am implementing right now but it is opening play store.I want to download whatsapp on click of the image. Please Guide.

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        img=(ImageView)findViewById(R.id.img);
        img.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse
                        ("http://play.google.com/store/apps/details?id=" + "com.whatsapp")));
            }

        });
    }
}
Rahul Sharma
  • 2,867
  • 2
  • 27
  • 40
Shivangi
  • 81
  • 2
  • 13

1 Answers1

1

check it... but you can't install directly without click on install button

Related topic 1

Related topic 2

Community
  • 1
  • 1
Nandkishor mewara
  • 2,552
  • 16
  • 29