2012-04-21 8 views
0

私はすべてのボタンを作っており、すべてのリンクはうまく動作しますが、問題は私がトップボタンから始めて選択してから、それぞれのボタンを操作する前に選択する必要があるということです。つまり、各ボタンを順番に選択するまでは、ボタンのどれも機能しません。私はここで簡単に何かが欠けていると確信しています。どんな助けもありがとう!リンクを持つ複数のボタンを作成するにはどうすればよいですか?

 package rainbow.cheetah.go.sms; 

import android.app.Activity; 
import android.os.Bundle; 
import android.os.Bundle; 
import android.app.Activity; 
import android.content.Intent; 
import android.net.Uri; 
import android.os.Bundle; 
import android.view.View; 
import android.view.View.OnClickListener; 
import android.widget.Button; 
public class RainbowCheetahGOSMSActivity extends Activity { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 


     Button btn = (Button) findViewById(R.id.More); 
     btn.setOnClickListener(new OnClickListener() { 
       public void onClick(View v) { 
         Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); 
         myWebLink.setData(Uri.parse("https://play.google.com/store/search?q=stealthychief&c=apps")); 
         startActivity(myWebLink); 



         Button btn = (Button) findViewById(R.id.match); 
         btn.setOnClickListener(new OnClickListener() { 
           public void onClick(View v) { 
             Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); 
             myWebLink.setData(Uri.parse("https://play.google.com/store/search?q=rainbow+cheetah+stealthychief&c=apps")); 
             startActivity(myWebLink); 


         Button btn = (Button) findViewById(R.id.rate); 
         btn.setOnClickListener(new OnClickListener() { 
           public void onClick(View v) { 
             Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); 
             myWebLink.setData(Uri.parse("https://play.google.com/store/apps/details?id=rainbow.cheetah.go.sms&feature=search_result#?t=W251bGwsMSwxLDEsInJhaW5ib3cuY2hlZXRhaC5nby5zbXMiXQ..")); 
             startActivity(myWebLink);    

             Button btn = (Button) findViewById(R.id.twitter); 
             btn.setOnClickListener(new OnClickListener() { 
               public void onClick(View v) { 
                 Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); 
                 myWebLink.setData(Uri.parse("https://twitter.com/#!/Stealthychief")); 
                 startActivity(myWebLink); 






         Button btn = (Button) findViewById(R.id.google); 
         btn.setOnClickListener(new OnClickListener() { 
           public void onClick(View v) { 
             Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); 
             myWebLink.setData(Uri.parse("https://plus.google.com/u/0/105194414710791941012/posts")); 
             startActivity(myWebLink);  } 
         });   
        } 
       }); 
    } 


    }); 

    } 
     }); 

}}); 

    }}; 

答えて

0

これは、あなたがかっこを完全に台無しにしたためです。あなたはこのようなものを意味すると思います。

public class RainbowCheetahGOSMSActivity extends Activity { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 

     Button btn = (Button) findViewById(R.id.More); 
     btn.setOnClickListener(new OnClickListener() { 
      public void onClick(View v) { 
       Intent myWebLink = new Intent(
         android.content.Intent.ACTION_VIEW); 
       myWebLink.setData(Uri 
         .parse("https://play.google.com/store/search?q=stealthychief&c=apps")); 
       startActivity(myWebLink); 
      } 
     }); 

     Button btn2 = (Button) findViewById(R.id.match); 
     btn2.setOnClickListener(new OnClickListener() { 
       public void onClick(View v) { 
         Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); 
         myWebLink.setData(Uri.parse("https://play.google.com/store/search?q=rainbow+cheetah+stealthychief&c=apps")); 
         startActivity(myWebLink); 
       } 
     }); 

     Button btn3 = (Button) findViewById(R.id.rate); 
     btn3.setOnClickListener(new OnClickListener() { 
       public void onClick(View v) { 
         Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); 
         myWebLink.setData(Uri.parse("https://play.google.com/store/apps/details?id=rainbow.cheetah.go.sms&feature=search_result#?t=W251bGwsMSwxLDEsInJhaW5ib3cuY2hlZXRhaC5nby5zbXMiXQ..")); 
         startActivity(myWebLink); 
       } 
     }); 

     Button btn4 = (Button) findViewById(R.id.twitter); 
     btn4.setOnClickListener(new OnClickListener() { 
       public void onClick(View v) { 
         Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); 
         myWebLink.setData(Uri.parse("https://twitter.com/#!/Stealthychief")); 
         startActivity(myWebLink); 
       } 
     }); 

     Button btn5 = (Button) findViewById(R.id.google); 
     btn5.setOnClickListener(new OnClickListener() { 
       public void onClick(View v) { 
         Intent myWebLink = new Intent(android.content.Intent.ACTION_VIEW); 
         myWebLink.setData(Uri.parse("https://plus.google.com/u/0/105194414710791941012/posts")); 
         startActivity(myWebLink); 
       } 
     }); 

    } 
} 
関連する問題