Android复选框可见性问题?

Android复选框可见性问题?,android,eclipse,checkbox,Android,Eclipse,Checkbox,在我的应用程序中,我有两个复选框,一个是PayByCredit,另一个是PayByMs,因为两个复选框都不可见。问题是什么?为了显示复选框,我给出了如下代码android:visibility=“visible”,但仍然没有用。有谁能帮我解决这个问题吗 我的XML代码是: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res

在我的应用程序中,我有两个复选框,一个是PayByCredit,另一个是PayByMs,因为两个复选框都不可见。问题是什么?为了显示复选框,我给出了如下代码
android:visibility=“visible”
,但仍然没有用。有谁能帮我解决这个问题吗

我的XML代码是:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/homescreeen2"
    android:orientation="vertical" >
    <RelativeLayout
        android:id="@+id/toplayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:fontFamily="Optima"
            android:gravity="center"
            android:text="@string/palmtreeimg"
            android:textColor="#ffffff"
            android:textStyle="bold" />
        <ImageButton
            android:id="@+id/imageButton1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_marginLeft="16dp"
            android:layout_marginTop="4dp"
            android:background="@null"
            android:contentDescription="@string/backbt"
            android:src="@drawable/backbt" />
    </RelativeLayout>
    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/toplayout"
        android:paddingBottom="10dp"
        android:scrollbars="none" >

        <RelativeLayout
            android:id="@+id/mainlayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:id="@+id/textView3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="15dp"
                android:layout_marginLeft="10dp"
                android:fontFamily="@+fonts/MontereyFLF"
                android:text="@string/realname"
                 android:textColor="#ff0000" />

            <LinearLayout
                android:id="@+id/mainlayout2"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/textView3"
                android:layout_margin="15dp"
                android:background="@drawable/layout_bg"
                android:orientation="vertical"
                android:paddingBottom="5dp" >
                <LinearLayout
                    android:id="@+id/getaplague"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    android:orientation="horizontal" >



                  <include
                        android:id="@+id/cmpndbtnName"
                        android:layout_gravity="center"
                        android:layout_margin="10dp"
                        android:layout_marginStart="@+id/treesplanted"
                        layout="@layout/compound_button" />
                </LinearLayout>

                <View
                    android:id="@+id/border"
                    android:layout_width="fill_parent"
                    android:layout_height="0.5dp"
                    android:layout_marginLeft="2dp"
                    android:layout_marginRight="2dp"
                    android:background="#a79a88"
                    android:visibility="gone" />

                <LinearLayout
                    android:id="@+id/entername"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="15dp"
                    android:alpha="0.8"
                    android:orientation="horizontal"
                    android:visibility="gone" >

                    <TextView
                        android:id="@+id/name"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/name"
                        android:textColor="#ff0000" />

                </LinearLayout>

                <ImageButton
                    android:id="@+id/imageButton3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginLeft="5dp"
                    android:background="@null"
                    android:contentDescription="@string/btn_save"
                    android:src="@drawable/savesmall"
                    android:visibility="gone" />
            </LinearLayout>
            <LinearLayout
                android:id="@+id/linearLayout1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/mainlayout2"
                android:layout_margin="15dp"
                android:background="@drawable/layout_bg"
                android:orientation="vertical" >

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    android:orientation="horizontal" >
      <include
                        android:id="@+id/cmpndbtnfrnname"
                        android:layout_marginStart="@+id/treesplanted"
                        layout="@layout/compound_buttonfrnname" />
                </LinearLayout>

                <View
                    android:layout_width="fill_parent"
                    android:layout_height="0.5dp"
                    android:layout_marginLeft="2dp"
                    android:layout_marginRight="2dp"
                    android:background="#a79a88" />
                <LinearLayout
                    android:id="@+id/enterfrnname"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="15dp"
                    android:alpha="0.8"
                    android:orientation="horizontal"
                    android:visibility="gone" >
 </LinearLayout>

                <View
                    android:layout_width="fill_parent"
                    android:layout_height="0.5dp"
                    android:layout_marginLeft="2dp"
                    android:layout_marginRight="2dp"
                    android:background="#a79a88" />

                <LinearLayout
                    android:id="@+id/enterfrnmailid"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="15dp"
                    android:orientation="horizontal"
                    android:visibility="gone" >
<EditText
                        android:id="@+id/editTextfrnmail"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:layout_weight="1"
                        android:background="@null"
                        android:hint="@string/enterfrnmailid"
                        android:inputType="text"
                         android:textSize="12sp"
                        android:paddingLeft="5dp"
                        android:textColor="#000000"
                        android:textColorHint="#999898" >
                    </EditText>
                </LinearLayout>

                <View
                    android:layout_width="fill_parent"
                    android:layout_height="0.5dp"
                    android:layout_marginLeft="2dp"
                    android:layout_marginRight="2dp"
                    android:background="#a79a88" />

                <LinearLayout
                    android:id="@+id/enterfrnphoneno"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="15dp"
                    android:orientation="horizontal"
                    android:visibility="gone" >

                    </EditText>
                </LinearLayout>

            </LinearLayout>
            <View
                android:layout_width="fill_parent"
                android:layout_height="0.5dp"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:background="#a79a88" />
            <View
                android:layout_width="fill_parent"
                android:layout_height="0.5dp"
                android:layout_marginLeft="2dp"
                android:layout_marginRight="2dp"
                android:background="#a79a88" />

            <LinearLayout
                android:id="@+id/linearLayout2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/linearLayout1"
                android:layout_margin="15dp"
                android:layout="@+id/amntlayout"
                android:orientation="horizontal" >


</LinearLayout>

            <LinearLayout
                android:id="@+id/mainlayoutpay"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/linearLayout2"
                android:layout_margin="15dp"
                android:background="@drawable/layout_bg"
                android:orientation="vertical"
                android:paddingBottom="5dp" >

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    android:orientation="horizontal" >

                    <TextView
                        android:id="@+id/txpaycredit"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:fontFamily="Optima"
                        android:text="@string/paycredit"
                        android:textColor="#ff0000" />

                     <TextView
                        android:id="@+id/dum"
                        android:layout_width="40dp"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:fontFamily="Optima"
                        android:text=""
                       />

                    <CheckBox
                        android:id="@+id/paycredit"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                       android:background="@null"
                       android:visibility="visible"
                      android:textColor="#000000" />
                </LinearLayout>

                <View
                    android:layout_width="fill_parent"
                    android:layout_height="0.5dp"
                    android:layout_marginLeft="2dp"
                    android:layout_marginRight="2dp"
                    android:background="#a79a88" />

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    android:layout_marginTop="0dp"
                    android:orientation="horizontal" >

                    <TextView
                        android:id="@+id/paybysms"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:text="@string/paysms"
                        android:textColor="#ff0000" />

                     <TextView
                        android:id="@+id/dummy"
                        android:layout_width="70dp"
                        android:layout_height="wrap_content"
                        android:layout_margin="10dp"
                        android:text=""
                        android:textColor="#ff0000" />

                    <CheckBox
                        android:id="@+id/paysms"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_margin="16dp"
                        android:background="@null"
                        android:visibility="visible"
                        android:layout_marginLeft="10dp"
                        android:fontFamily="@+fonts/MontereyFLF"
                        android:textColor="#000000" />
                </LinearLayout>


            </LinearLayout>
        </RelativeLayout>
    </ScrollView>

</RelativeLayout>

我的.java代码在这里:

import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.paypal.android.sdk.payments.PayPalConfiguration;
import com.paypal.android.sdk.payments.PayPalPayment;
import com.paypal.android.sdk.payments.PayPalService;
import com.paypal.android.sdk.payments.PaymentActivity;
import com.paypal.android.sdk.payments.PaymentConfirmation;

public class PalmTreeActivity extends Activity {

    //Used for payment
    double currencyAftconversion;
    public String treeValue;
    private static final String CONFIG_ENVIRONMENT = PayPalConfiguration.ENVIRONMENT_NO_NETWORK;
    private static final String CONFIG_CLIENT_ID = "AWg-FRC9GM1CdolC2XnKnYBEgpi01jDlKi6IEXFcEnu4QIfer6cVE0iH9YNI";

    private static PayPalConfiguration config = new PayPalConfiguration()
            .environment(CONFIG_ENVIRONMENT)
            .clientId(CONFIG_CLIENT_ID)
            .merchantName("Isaaf")
            .merchantPrivacyPolicyUri(
                    Uri.parse("https://www.example.com/privacy"))
            .merchantUserAgreementUri(
                    Uri.parse("https://www.example.com/legal"));

    String AmountOfTree = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        String price = null;

        //call currency conversion method
        new DownloadCurrencyConversion().execute();

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_palmtree);
        ImageButton btnNext = (ImageButton) findViewById(R.id.imageButton2);
        ImageButton btBack = (ImageButton) findViewById(R.id.imageButton1);

        final CheckBox paybycard = (CheckBox) findViewById(R.id.paycredit);
        //paycredit.setVisibility(View.VISIBLE);
        final CheckBox paybysms = (CheckBox) findViewById(R.id.paysms);
         final  CompoundButton   switchrealname= (CompoundButton) findViewById(R.id.enabled);
        final  CompoundButton switchfrnname=(CompoundButton) findViewById(R.id.enabledfrnname);
         final LinearLayout friendName=(LinearLayout) findViewById(R.id.enterfrnname);
         final LinearLayout friendMailId=(LinearLayout) findViewById(R.id.enterfrnmailid);
         final LinearLayout friendPhoneno=(LinearLayout) findViewById(R.id.enterfrnphoneno);
         final LinearLayout Name=(LinearLayout) findViewById(R.id.entername);
         final EditText username=(EditText)findViewById(R.id.editText1);
         final EditText frnName=(EditText)findViewById(R.id.editTextfrnName);
         final EditText frnmail=(EditText)findViewById(R.id.editTextfrnmail);
         final EditText frnphoneno=(EditText)findViewById(R.id.editTextfrnphoneno);
//       final ImageButton savename=(ImageButton)findViewById(R.id.imageButton3);
//       final ImageButton savefrnname=(ImageButton) findViewById(R.id.imageButton4);

        if (getIntent().getExtras() != null && !TextUtils.isEmpty("price"))
        {
            price = getIntent().getExtras().getString("price");
            TextView amount = (TextView) findViewById(R.id.amountvalue);
            amount.setGravity(Gravity.CENTER);
            String Pricedouble = price.substring(price.indexOf('('));
            Pricedouble = Pricedouble.replaceAll("\\D+", "");
            amount.setText(Pricedouble.toString()); // Get Number

            //EditText amounttext = (EditText) findViewById(R.id.editText1);
            //amounttext.setText(Pricedouble);
        AmountOfTree = Pricedouble.toString();

        Intent intentActivity = new Intent(this, PayPalService.class);

        intentActivity.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);

        startService(intentActivity);
        }

        //button next click
        btnNext.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                if (paybycard.isChecked()) {
                    Bundle bundle=new Bundle();
                    if(!TextUtils.isEmpty(username.getText().toString()))
                    bundle.putString("name", username.getText().toString());
                    if(!TextUtils.isEmpty(frnName.getText().toString()))
                    bundle.putString("frnname", frnName.getText().toString());
                    if(!TextUtils.isEmpty(frnmail.getText().toString()))
                    bundle.putString("frnmailid", frnmail.getText().toString());

                    if(!TextUtils.isEmpty(frnphoneno.getText().toString()))
                    bundle.putString("frnphoneno", frnphoneno.getText().toString());
                    PayPalPayment payment = new PayPalPayment(new BigDecimal(
                            currencyAftconversion), "USD", "Tree",
                            PayPalPayment.PAYMENT_INTENT_SALE);

                    Intent intent = new Intent(getApplicationContext(),
                            PaymentActivity.class);

                    intent.putExtra(PaymentActivity.EXTRA_PAYMENT, payment);

                    startActivityForResult(intent, 0);
                }
                else if(paybysms.isChecked())
                {

                    StringBuilder tmp=new StringBuilder();
                    if(!TextUtils.isEmpty(username.getText().toString()));
                    tmp.append("User details are :"+"\n");
                    tmp.append("UserName is:"+username.getText().toString());
                    tmp.append("\n");
                    //tmp.append(username.getText().toString());
                    if(!TextUtils.isEmpty(frnName.getText().toString()))
                    tmp.append("Friend Name is:"+frnName.getText().toString());
                    tmp.append("\n");

                    if(!TextUtils.isEmpty(frnmail.getText().toString()))
                    tmp.append("Friend Email id is:"+frnmail.getText().toString());
                    tmp.append("\n");
                    if(!TextUtils.isEmpty(frnphoneno.getText().toString()))

                    tmp.append("Friend phone number is:"+frnphoneno.getText().toString());

                    PayByCash senddetailstoadmin=new PayByCash();
                    if(!TextUtils.isEmpty(tmp.toString()))
                    senddetailstoadmin.execute(tmp.toString());
                    Toast paymessage=Toast.makeText(getApplicationContext(), "Our customer care people will contact you shortly..!!!!", Toast.LENGTH_SHORT);
                        paymessage.show();

                    Intent intent=new Intent( getApplicationContext(),PaycashthanksActivity.class);
                    startActivity(intent);


                }
                else 
                {
                    Toast paywarning=Toast.makeText(getApplicationContext(), "Please pay using card or pay by cash", Toast.LENGTH_SHORT);
                    paywarning.show();
                }
                }
            });

        btBack.setOnClickListener(new OnClickListener() {
            public void onClick(View view) {
                Intent intent = new Intent(getApplicationContext(),
                        FindmarkedLocationActivity.class);
                startActivity(intent);

            }
        });

        //switchrealname toggle

        switchrealname.setOnCheckedChangeListener(new OnCheckedChangeListener()
        {
            @Override
            public void onCheckedChanged(CompoundButton buttonView,
             boolean isChecked)
            {

                if(switchrealname.isChecked())
                {
                    Name.setVisibility(View.VISIBLE);  //Set the layout visible
//                  savename.setVisibility(View.VISIBLE);



                }
                else
                {
                    Name.setVisibility(View.GONE);  
//                  savename.setVisibility(View.GONE);

                }
        }

    });

        //Switch friend details switch toggle checked event
        switchfrnname.setOnCheckedChangeListener(new OnCheckedChangeListener()
        {
            @Override
            public void onCheckedChanged(CompoundButton buttonView,
             boolean isChecked)
            {

                if(switchfrnname.isChecked())
                {
                     //Set the layout visible
                    friendName.setVisibility(View.VISIBLE);
                    friendMailId.setVisibility(View.VISIBLE);
                    friendPhoneno.setVisibility(View.VISIBLE);
                   // savefrnname.setVisibility(View.VISIBLE);
                }
                else
                {
                      //Set the layout visible
                    friendName.setVisibility(View.GONE);
                    friendMailId.setVisibility(View.GONE);
                    friendPhoneno.setVisibility(View.GONE);
//                  savefrnname.setVisibility(View.GONE);
                }
        }

    });
    }




        @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {

            if (resultCode == Activity.RESULT_OK) {
                PaymentConfirmation confirm = data
                        .getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);
                if (confirm != null) {
                    try {
                        Log.i("paymentExample", confirm.toJSONObject().toString(4));

                        // TODO: send 'confirm' to your server for verification or
                        // consent
                        // completion.
                        // see
                        // https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/
                        // for more details.
                        Intent intent = new Intent(getApplicationContext(),
                                CongratulationActivity.class);
                        startActivity(intent);

                    } 
                    catch (JSONException e)
                    {
                        sorryActivity();
                        Log.e("paymentExample",
                                "an extremely unlikely failure occurred: ", e);

                    }
                }
            } else if (resultCode == Activity.RESULT_CANCELED) {
                Log.i("paymentExample", "The user canceled.");
            } else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) 
            {
                sorryActivity();
                Log.i("paymentExample",
                        "An invalid Payment was submitted. Please see the docs.");

            }
        }

//back button click


    public String getJson(String url) throws ClientProtocolException,
    IOException {
StringBuilder build = new StringBuilder();
HttpClient client = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
HttpResponse response = client.execute(httpGet);
HttpEntity entity = response.getEntity();
InputStream content = entity.getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(
        content));
String con;
while ((con = reader.readLine()) != null) {
    build.append(con);
}
return build.toString();
}


public void sorryActivity()
{
Intent intent = new Intent(getApplicationContext(),
        SorryPaymentActivity.class);
startActivity(intent);
}

@Override
public void onDestroy() {
stopService(new Intent(this, PayPalService.class));
super.onDestroy();
}

    public class DownloadCurrencyConversion extends
    AsyncTask<Void, Integer, String> {

@Override
protected String doInBackground(Void... params) {
    String s;
    String theResult = "";
    try {
        s = getJson("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20%28%22BHDUSD%22%29&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=");
        JSONObject jObj;
        jObj = new JSONObject(s);
        theResult = jObj.getJSONObject("query")
                .getJSONObject("results").getJSONObject("rate")
                .getString("Rate");

        System.out.println(theResult);

    }

    catch (JSONException e) {
        e.printStackTrace();
    } catch (ClientProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    return theResult;
}

@Override
protected void onPostExecute(String theResult) {
    super.onPostExecute(theResult);

    System.out.println("theResult:" + theResult);
    if (!TextUtils.isEmpty(theResult) &&!TextUtils.isEmpty(AmountOfTree) )
        currencyAftconversion = (Double.parseDouble(AmountOfTree))
                * (Double.parseDouble(theResult));

}
}
}
导入android.widget.CheckBox;
导入android.widget.CompoundButton;
导入android.widget.CompoundButton.OnCheckedChangeListener;
导入android.widget.EditText;
导入android.widget.ImageButton;
导入android.widget.LinearLayout;
导入android.widget.TextView;
导入android.widget.Toast;
导入com.paypal.android.sdk.payments.paypal配置;
导入com.paypal.android.sdk.payments.PayPalPayment;
导入com.paypal.android.sdk.payments.PayPalService;
导入com.paypal.android.sdk.payments.PaymentActivity;
导入com.paypal.android.sdk.payments.PaymentConfirmation;
公共类PalmTreeActivity扩展了活动{
//用于支付
双电流转换;
公共字符串treeValue;
私有静态最终字符串CONFIG_ENVIRONMENT=PayPalConfiguration.ENVIRONMENT_NO_NETWORK;
私有静态最终字符串配置_CLIENT_ID=“AWg-FRC9GM1CdolC2XnKnYBEgpi01jDlKi6IEXFcEnu4QIfer6cVE0iH9YNI”;
私有静态PayPalConfiguration=new PayPalConfiguration()
.environment(配置_环境)
.clientId(配置客户端ID)
.商品名称(“Isaaf”)
.merchantPrivacyPolicyUri(
解析https://www.example.com/privacy"))
.merchantUserAgreementUri(
解析https://www.example.com/legal"));
字符串AmountOfTree=null;
@凌驾
创建时受保护的void(Bundle savedInstanceState){
字符串价格=空;
//调用货币转换方法
新下载的CurrencyConversion().execute();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_palmtree);
ImageButton btnNext=(ImageButton)findViewById(R.id.imageButton2);
ImageButton btBack=(ImageButton)findViewById(R.id.imageButton1);
最终复选框paybycard=(复选框)findViewById(R.id.paycredit);
//paycredit.setVisibility(View.VISIBLE);
最终复选框paybysms=(复选框)findViewById(R.id.paysms);
最终复合按钮开关realname=(复合按钮)findViewById(R.id.enabled);
最终复合按钮开关FRNNAME=(复合按钮)findViewById(R.id.enabledfrnname);
最终LinearLayout friendName=(LinearLayout)findViewById(R.id.enterfrnname);
最终LinearLayout Friendmaild=(LinearLayout)findViewById(R.id.EnterfrnMaild);
最终LinearLayout friendPhoneno=(LinearLayout)findViewById(R.id.enterfrnphoneno);
最终LinearLayout名称=(LinearLayout)findViewById(R.id.entername);
最终EditText用户名=(EditText)findViewById(R.id.editText1);
最终EditText frnName=(EditText)findViewById(R.id.editTextfrnName);
最终EditText frnmail=(EditText)findViewById(R.id.editTextfrnmail);
最终编辑文本frnphoneno=(编辑文本)findViewById(R.id.editTextfrnphoneno);
//最终ImageButton savename=(ImageButton)findViewById(R.id.imageButton3);
//最终ImageButton savefrnname=(ImageButton)findViewById(R.id.imageButton4);
if(getIntent().getExtras()!=null&&!TextUtils.isEmpty(“价格”))
{
价格=getIntent().getExtras().getString(“价格”);
TextView金额=(TextView)findViewById(R.id.amountvalue);
数量。设置重力(重心);
字符串Pricedouble=price.substring(price.indexOf('('));
Pricedouble=Pricedouble.replaceAll(“\\D+”,”);
amount.setText(Pricedouble.toString());//获取数字
//EditText amounttext=(EditText)findViewById(R.id.editText1);
//amounttext.setText(Pricedouble);
AmountOfTree=Pricedouble.toString();
意向意向性=新意向(这个,PayPalService.class);
intentActivity.putExtra(PayPalService.EXTRA\u PAYPAL\u配置,config);
startService(意向性);
}
//按钮下一步单击
setOnClickListener(新的OnClickListener(){
@凌驾
公共void onClick(视图){
if(paybycard.isChecked()){
Bundle=新Bundle();
如果(!TextUtils.isEmpty(username.getText().toString()))
bundle.putString(“name”,username.getText().toString());
如果(!TextUtils.isEmpty(frname.getText().toString()))
bundle.putString(“frname”,frname.getText().toString());
如果(!TextUtils.isEmpty(frnmail.getText().toString()))
bundle.putString(“frnmaild”,frnmail.getText().toString());
如果(!TextUtils.isEmpty(frnphoneno.getText().toString()))
putString(“frnphoneno”,frnphoneno.getText().toString());
paybycard.setVisibility(0);
paybysms.setVisibility(0);
<CheckBox
    android:id="@+id/paysms"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="16dp"
    android:background="@null"
    android:visibility="visible"
    android:text="pay with sms"
    android:layout_marginLeft="10dp"
    android:textColor="#000000" />
<CheckBox
    android:id="@+id/paycredit"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/paysms"
    android:background="@null"
    android:text="pay credit"
    android:visibility="visible"
    android:layout_marginLeft="10dp"
    android:textColor="#000000" />