Answers for "reviews button ade android studio"

-1

reviews button ade android studio

Button.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                final String myappPackageName = getPackageName(); // getPackageName() from Context or Activity object
                try {
                 startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + myappPackageName)));
                } catch (android.content.ActivityNotFoundException anfe) {
                 startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + myappPackageName)));
            }
        });
Posted by: Guest on August-25-2021

Browse Popular Code Answers by Language