毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> 移动平台 >> 正文

You must supply a resource ID for a TextView

更新时间:2014-11-22:  来源:毕业论文

Package cn.com.ava.lesson4_fancy_view;
 
import android.content.Context;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
 
import java.util.ArrayList;
import java.util.List;
 
import cn.com.ava.lesson4_fancy_view.Model.Address;
 
public class MainActivity extends Activity {
 
    private EditText et_name;
    private EditText et_address;
    private Button bt_save;
    private RadioGroup rg_types;
    private RadioButton rb_take_out;
    private RadioButton rb_sit_down;
    private RadioButton rb_delivery;
    private ListView lv_address;
 
    private ArrayAdapter<Address> adapter;
    private List<Address> listAddress = new ArrayList<Address>();
 
    private static final String TAG = "MainActivity";
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        this.bt_save = (Button) this.findViewById(R.id.bt_save);
        this.bt_save.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                et_name = (EditText) MainActivity.this.findViewById(R.id.et_name);
                et_address = (EditText) MainActivity.this.findViewById(R.id.et_address);
                rg_types = (RadioGroup) MainActivity.this.findViewById(R.id.rg_types);
                rb_take_out = (RadioButton) MainActivity.this.findViewById(R.id.rb_take_out);
                rb_sit_down = (RadioButton) MainActivity.this.findViewById(R.id.rb_sit_down);
                rb_delivery = (RadioButton) MainActivity.this.findViewById(R.id.rb_delivery);
 
                Address address = new Address();
                address.setName(et_name.getText().toString());
                address.setAddress(et_address.getText().toString());
                switch (rg_types.getCheckedRadioButtonId()) {
                    case R.id.rb_take_out:
                        address.setType(MainActivity.this.getString(R.string.take_out));
                        break;
                    case R.id.rb_sit_down:
                        address.setType(MainActivity.this.getString(R.string.sit_down));
                        break;
                    case R.id.rb_delivery:
                 &nb

[1] [2] [3] [4] 下一页

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。