Android应用程序崩溃与fortumo应用内付款

时间:2011-01-12 00:41:04

标签: android crash in-app-purchase fortumo

应用代码

package com.musicdownloader;

import com.fortumo.android.PaymentActivity;
import com.musicdownloader.R;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.view.View.OnClickListener;

public class app extends PaymentActivity {
 @Override
   public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

           setContentView(R.layout.main);

           makePayment();



           Button payButton = (Button) findViewById(R.id.Next);
           payButton.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {

                    final EditText q = (EditText) findViewById(R.id.q);
                 Intent i = new Intent("android.intent.action.VIEW", Uri.parse("http://www.google.com/search?btnI&q=zippyshare" +q.getText().toString()));
                 startActivity(i);

                   }
           });

   }

 @Override
 protected void onPaymentCanceled(String arg0) {
  // TODO Auto-generated method stub

 }

 @Override
 protected void onPaymentFailed(String arg0) {
  // TODO Auto-generated method stub

 }

 @Override
 protected void onPaymentPending(long arg0, String arg1) {
  // TODO Auto-generated method stub

 }

 @Override
 protected void onPaymentSuccess(String arg0) {
  // TODO Auto-generated method stub

 }  
}

,xml文件是

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.musicdownloader"
  android:versionCode="1"
  android:versionName="1.0" android:installLocation="auto">
  <supports-screens
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:resizeable="true"
    android:anyDensity="true"
    />
    <application android:icon="@drawable/icon" android:label="@string/app_name">




<activity android:name=".app">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>


  <activity android:theme="@android:style/Theme.Translucent.NoTitleBar" android:name="com.fortumo.android.FortumoActivity" android:taskAffinity="com.fortumo.android.FortumoActivity"/>
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />   
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />   
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.INSTALL_PACKAGES" />
  <uses-permission android:name="android.permission.READ_OWNER_DATA" />
  <uses-permission android:name="android.permission.WRITE_OWNER_DATA" />
  <uses-permission android:name="android.permission.WRITE_SETTINGS" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_CONTACTS" />

</application>

</manifest>

我希望有人帮助我支付应用程序付款的费用。为什么应用程序崩溃?

1 个答案:

答案 0 :(得分:0)

建议在onclick按钮上调用makepayment。这会触发短信付款周期。

修改

建议您在清单中添加PaymentActivity以及fortumoactivity即。两个活动都需要声明。