English 中文(简体)
Android rate rate
原标题:Android rate button syntax errors
  • 时间:2011-07-09 05:55:55
  •  标签:
  • java
  • android

我在“市值”上发现了“Syntax”错误。 之后,预计会收到:https://market.以及roid.com/details?id=com.synameegas.giveaway”;

以及

2. 先发制人(市场)的先发制人错误。

        private void makeDialog() {     

        AlertDialog.Builder about = new AlertDialog.Builder(this);      

        about.setMessage("About The Giveaway");

        about.setPositiveButton("Rate", new DialogInterface.OnClickListener() {
            Intent market = new Intent(
                    "以及roid.intent.action.VIEW", 

                startActivity(market);
            public void onClick(DialogInterface arg0, int arg1) {
//action
            }
        });

        about.setNegativeButton("Close", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface arg0, int arg1) {}
        });

        about.show();
    }

}
最佳回答

Please try this, I had tested the code and working as per requirement..

2. 警惕。 1. 建设新警示组织。

    about.setMessage("About The Giveaway");

    about.setPositiveButton("Rate", new DialogInterface.OnClickListener() 
    {
        Intent market = new Intent("android.intent.action.VIEW",Uri.parse("https://market.android.com/details?id=com.synamegames.giveaway"));

        public void onClick(DialogInterface arg0, int arg1) 
        {
                    //action
            startActivity(market);  

        }
    });

    about.setNegativeButton("Close", new DialogInterface.OnClickListener() 
    {
        public void onClick(DialogInterface arg0, int arg1) 
        {

        }
    });

    about.show();

试图在Main/UI Thread操作该守则。

问题回答

我认为,你有两个问题。

首先,请在座标有误的方括号:

Intent market = new Intent(
    "android.intent.action.VIEW", 
    Uri.parse("https://market.android.com/details?id=com.synamegames.giveaway");
startActivity(market);

我认为,在/code>打电话之后,你需要打字,以关闭Intent Constructionor打电话:

Intent market = new Intent(
    "android.intent.action.VIEW", 
    Uri.parse("https://market.android.com/details?id=com.synamegames.giveaway"));
startActivity(market);

或摘录<代码>Uri.parse 呼吁首先:

Uri uri = Uri.parse("https://market.android.com/details?id=com.synamegames.giveaway");
Intent market = new Intent("android.intent.action.VIEW", uri);
startActivity(market);

第二,你在以下表格中有效地浏览了一套代码:内子类,而不是初始器组或方法。 您是否打算将其列入<条码>onClick。

about.setPositiveButton("Rate", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface arg0, int arg1) {
        Uri uri = Uri.parse("...");
        Intent market = new Intent("android.intent.action.VIEW", uri);
        startActivity(market);
    }
});




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签