-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的文檔來回答問題。 –