何十億回も見てきましたが、答えが見つかりません。クリック時に edittext ボックスに定義済みのテキストを入力するにはどうすればよいですか? ボタンにステートメントを読んでもらいたいのですが、ユーザーがボタンをクリックすると、テキストに添付された URL が表示されます。
3 に答える
            4        
        
		
何が欲しいかわからない...
final EditText edit = (EditText) this.findViewById(R.id.editText1);
Button btn = (Button) this.findViewById(R.id.button1);
btn.setOnClickListener(new OnClickListener() {
    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        edit.setText("your text");
    }
});
    于 2012-05-08T02:45:05.967   に答える
    
    
            2        
        
		
これがお役に立てば幸いです
button = (Button)findViewById(R.id.button1);
editText = (EditText)findViewById(R.id.editText1);
    final String _url = "http://yoururl";
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            editText.setText(_url);
        }
    });
    于 2012-05-08T02:53:31.307   に答える
    
    
            1        
        
		
EditText.setText("ここにテキスト");
それはあなたがする必要があるすべてです。(まあ、それをクリックリスナーにラップしてIDを取得しますが、それは知っていると思います)。
于 2012-05-08T02:47:13.987   に答える