Android 調用已安裝市場,進行軟體評分的功能實現

來源:互聯網
上載者:User

標籤:

exntends:http://blog.csdn.net/wangfayinn/article/details/10351655

 

項目中要有一個給軟體評分的功能,一個很常見,很簡單的功能,卻費了我不小功夫。需要實現的效果如下:

 

本來以為一般的軟體都會有“去評分”、“親,給個好評”這樣的功能,但是在網上搜了搜竟沒有搜到,問了三個群外加5個童鞋,分析log,反編譯看源碼,終於找到了這個uri,擷取他真不容易啊。

 

try {
Uri uri = Uri.parse("market://details?id=" + getPackageName());
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
} catch (Exception e) {
showToast("尚未安裝應用市場");
e.printStackTrace();
}

 

通過以上代碼就能夠列出您手機上所安裝的所有應用市場(如:google player、豌豆莢、360手機小幫手等),讓您選擇。

加點福利吧,把調用分享的代碼也貼出來,免得以後到處找:

 

Intent sendIntent = new Intent();  sendIntent.setAction(Intent.ACTION_SEND);  sendIntent.setType("text/*");  sendIntent.putExtra(Intent.EXTRA_TEXT, contentEditText.getText().toString());  startActivity(sendIntent);  

 

 

Android 調用已安裝市場,進行軟體評分的功能實現

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.