2012-05-26 57 views
-1

例如:我有一個UI項目包含一個按鈕.. 活動:獲取Android的代碼串

package android.tuanshaker.myproject.com; 
import android.app.Activity; 
import android.os.Bundle; 

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

而且main.xml文件:

<?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:orientation="vertical" > 

<Button 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello" /> 

</LinearLayout> 

我想顯示的代碼和xml我的項目通過textview ..我怎麼能得到他們?

回答