2012-07-17 3 views
-1
  • 하나의 버튼과 하나의 edittext로 간단한 xml을 만들었습니다.
  • 버튼을 클릭하면 CallLog 페이지로 들어갈 수 있습니다.
  • 내 CallLog에서 임의의 숫자를 클릭하면 선택한 번호를 내 EditText에 표시 할 수 있습니까 ??

XML :내 edittext에 CallLog 번호를 표시 할 수 있습니까? 새로운 여기

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:baselineAligned="true" 
android:orientation="horizontal" > 

<EditText 
android:id="@+id/edittext" 
android:layout_width="172dp" 
android:layout_height="wrap_content" 
android:layout_weight="0.29" 
android:hint="CONTACT NUMBER" > 

<requestFocus /> 
</EditText> 

<Button 
android:id="@+id/btn" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="CALL LOG" /> 

</LinearLayout> 

코딩 :

import android.app.Activity; 
import android.content.Intent; 
import android.os.Bundle; 
import android.view.View; 
import android.widget.Button; 

public class CallLogRetrieveActivity extends Activity { 

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

myCallLogBtn=(Button)findViewById(R.id.btn); 

myCallLogBtn.setOnClickListener(new Button.OnClickListener(){ 

    public void onClick(View v) { 

     Intent myIntent=new Intent(); 
     myIntent.setAction(Intent.ACTION_CALL_BUTTON); 
     startActivity(myIntent); 

    }}); 
} 
} 

답변

0

당신은 당신이 단순히 RTFM을 수행 한 후 알 것 초등학교 것들에 대해 여기 요구하고 있지, 처음으로 수동 및 튜토리얼을 읽기 시작한다. 그래서 "예, 할 수 있어요". 하지만 지금은 "안드로이드 전화 로그 자습서"봤어요 자료를 읽고 숙제를하시기 바랍니다. 여기 아무도 당신을 위해 그렇게하지 않습니다.

관련 문제