-1
我想在Google Play商店中创建付费应用程序。谁能告诉我怎么在这里做这是我的主要活动在官方Android市场中创建付费应用程序
`public class MainActivity extends Activity {
//private Button button;
private WebView webView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Get webview
webView = (WebView) findViewById(R.id.webview);
webView.loadUrl("file:///android_asset/Index.html");
// Open previous opened link from history on webview when back button pressed
@Override
// Detect when the back button is pressed
public void onBackPressed() {
if(webView.canGoBack()) {
webView.goBack();
} else {
// Let the system handle the back button
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == R.id.disclaimer) {
Intent k = new Intent(this, Webscreen.class);
k.putExtra(cf.droiddev.oursolarsystem.Webscreen.URL,
"file:///android_asset/Disclaimer.html");
startActivity(k);
return true;
}
if(item.getItemId() == R.id.about) {
Intent j = new Intent(this, About.class);
startActivity(j);
return true;
}
if(item.getItemId() == R.id.exit) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
MainActivity.this);
// set title
alertDialogBuilder.setIcon(android.R.drawable.ic_dialog_alert).setTitle("Exit App");
// set dialog message
alertDialogBuilder
.setMessage("Do you want to exit")
.setCancelable(false)
.setPositiveButton("Yes",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,int id) {
// if this button is clicked, close
// current activity
MainActivity.this.finish();
}
})
.setNegativeButton("No",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,int id) {
// if this button is clicked, just close
// the dialog box and do nothing
dialog.cancel();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
return true;
}
return super.onOptionsItemSelected(item);
}
}`
,这里是我的主要activity.xml
`
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</RelativeLayout>`
任何帮助,将不胜感激。我尝试了谷歌的文档,但它给我的项目错误
我已upvoted它取消愚蠢downvote(这是没有评论)。 –
您需要发布您的应用(http://teamtreehouse.com/library/publish-an-android-app?cid=1000),然后在[dev console](https://play.google.com)中指定/ apps/publish /)您的列表价格。 –
@RohitGupta没有downvote,但downvotes不需要评论,并不愚蠢。他们是意见。只是为了取消某人的意见而进行的举措是不好的做法。这个问题很糟糕,因为代码与实际问题没有任何关系,并且可以通过转到Google的文档来回答问题。 –