Senin, 29 Juli 2019

rate my app

JavaXml import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.ActivityNotFoundException; import android.content.Intent; import android.net.Uri; import android.view.View; import android.widget.Button; import android.widget.Toast; public class Ratethisapp extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_ratethisapp); Button btnRate = (Button) findViewById(R.id.button); btnRate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onClickRateThisApp(v); } }); } private boolean isActivityStarted(Intent aIntent) { try { startActivity(aIntent); return true; } catch (ActivityNotFoundException e) { return false; } } public void onClickRateThisApp(View v) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("market://details?id=com.tutorial.personal.androidstudiopro")); if (!isActivityStarted(intent)) { intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.tutorial.personal.androidstudiopro")); if (!isActivityStarted(intent)) { Toast.makeText(this, "Could not open Android market, please check if the market app installed or not. Try again later", Toast.LENGTH_SHORT).show(); } } } }

Tidak ada komentar:

Posting Komentar

bangsat

 goblok