Android 安卓包裹以alsa信息结束

Android 安卓包裹以alsa信息结束,android,parcel,Android,Parcel,在访问某个对象成员的活动之间传递包裹后,该对象成员包含来自textview内容的简单字符串,最终包含以下内容: “[04-11 20:47:31.347 84:0x78 I/AudioHardwareALSA] 已初始化ALSA播放设备AndroidPlayback_扬声器_normal“ 这怎么可能呢 休闲是令人讨厌的对象 public class user implements Parcelable { public static final Parcelable.Creator C

在访问某个对象成员的活动之间传递包裹后,该对象成员包含来自textview内容的简单字符串,最终包含以下内容:

“[04-11 20:47:31.347 84:0x78 I/AudioHardwareALSA] 已初始化ALSA播放设备AndroidPlayback_扬声器_normal“

这怎么可能呢

休闲是令人讨厌的对象

public class user implements Parcelable {
    public static final Parcelable.Creator CREATOR = new UserCreator();
private String EMPTY_FIELD = "empty_field";
public String username;
public String firstname;
public String lastname;
public String id;
public String timezone; 
public String language;
public String profession;
public String age;
public String location;
public String bio ;
public String gender;
public String status;
public String sipuri;
public String imgurl;
public String urlprefix = "http://sip.netchosis.com/images/";
public String phone;
public String email;
public String auth;

public user(Parcel source) {
    username = source.readString();
    firstname = source.readString();
    lastname = source.readString();
    id = source.readString();
    timezone = source.readString();
    language = source.readString();
    profession = source.readString();
    age = source.readString();
    location = source.readString();
    bio = source.readString();
    gender = source.readString();
    status = source.readString();
    imgurl = source.readString();
    email = source.readString();
    phone = source.readString();
    auth = source.readString();

  try{
    sipuri = username.replaceAll("@", "-");
  }
  catch (NullPointerException e){
      sipuri = username +"-"+"nousername.com";

  }
    sipuri = sipuri+"@sip.netchosis.com";
}
public String getImgurl() {
    return imgurl;
}
public void setImgurl(String imgurl) {
    this.imgurl = urlprefix+ imgurl+".phone.jpg";
}
public String getStatus() {
    return status;
}
public void setStatus(String status) {
    this.status = status;
}
public user() {
    // TODO Auto-generated constructor stub
}
public String getAuth(){
    Log.d("getauth",auth);
    return auth;
}
public void setAuth(String Auth){
    Log.d("setauth:",Auth);
    this.auth = Auth;
    Log.d("this.auth", this.auth);
}
public String getUsername() {
    return username;
}
public void setUsername(String username) {
    this.username = username;
}
public String getAge() {
    return age;
}
public void setAge(String age) {
    this.age = age;
}
public String getLocation() {
    return location;
}
public void setLocation(String location) {
    this.location = location;
}
public String getBio() {

    return bio;
}
public void setBio(String bio) {
    this.bio = bio;
}
public void setEmail(String email){
    this.email = email;
}
public void setPhone(String phone){
    this.phone = phone;
}
public String getFirstname() {
    if (this.firstname != null){
        return firstname;
    }
    else {
        return "firname issue";
    }
}
public String getEmail () {
    return this.email;
}
public String getPhone(){

    return phone;
}
public String getsupuri(){
    return sipuri;
}
public void setFirstname(String firstname) {
    this.firstname = firstname;
}
public String getLastname() {
    if (this.lastname != null){
        return this.lastname;
    }
    else{
        return "lastname issue";
    }

}
public void setLastname(String lastname) {

    this.lastname = lastname;
}
public String getId() {
    return id;
}
public void setId(String id) {
    this.id = id;
}
public String getTimezone() {
    return timezone;
}
public void setTimezone(String timezone) {
    this.timezone = timezone;
}
public String getLanguage() {
    return language;
}
public String getGender() {
    return gender;
}
public void setGender(String gender) {
    this.gender = gender;
}
public void setLanguage(String language) {
    this.language = language;
}
public String getProfession() {
    return profession;
}
public void setProfession(String profession) {
    this.profession = profession;
}
@Override
public int describeContents() {
    // TODO Auto-generated method stub
    return 0;
}
@Override
public void writeToParcel(Parcel arg0, int arg1) {
    arg0.writeString(username);
    arg0.writeString(firstname);
    arg0.writeString(lastname);
    arg0.writeString(id);
    arg0.writeString(timezone);
    arg0.writeString(language);
    arg0.writeString(profession);
    arg0.writeString(age);
    arg0.writeString(location);
    arg0.writeString(bio);
    arg0.writeString(gender);
    arg0.writeString(status);
    arg0.writeString(imgurl);
    arg0.writeString(email);
    arg0.writeString(phone);
    arg0.writeString(auth);

}
}

这就是我如何访问“phone”变量的问题所在

public class editprofile extends Activity  {
public final static String C_USER = "com.example.project2.CUSER";
private EditText firstname_box;
private EditText lastname_box;
private EditText username_box;
private EditText email_box;
private EditText phone_box;
private EditText profession_box;
private EditText bio_box;
private Spinner gender_box;
private CheckBox accept_calls;
private static user currentuser;
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent  intent = getIntent();
    Bundle cu = intent.getExtras();
    currentuser = cu.getParcelable(Getusers.CURRENT_USER);
    setCurrentuser(currentuser); // Really not sure why this needs to happen
    Log.d("EDITPROFILE CREATED", currentuser.getUsername());

    setContentView(R.layout.fragment_editprofile);

    populate_profile();
}

public void setCurrentuser(user currentuser) {this.currentuser = currentuser;}

protected void populate_profile(){
    firstname_box = (EditText) findViewById(R.id.fnamebox1);
    lastname_box = (EditText) findViewById(R.id.lnamebox);

    phone_box = (EditText) findViewById(R.id.phonebox);

    bio_box = (EditText) findViewById(R.id.bio1);
    email_box = (EditText) findViewById(R.id.email_box);
    gender_box = (Spinner) findViewById(R.id.Gender);


    try{
        firstname_box.setText(currentuser.getFirstname());

    }
    catch (NullPointerException e){
        firstname_box.setText(null);
    }

    lastname_box.setText(currentuser.getLastname());
    Log.d("phone_box", currentuser.getPhone().toString()); // This is where I get strange output 
    phone_box.setText(currentuser.getFirstname());
    bio_box.setText(currentuser.getBio());
    email_box.setText(currentuser.getEmail());
}

public void Save(View view){ // happends when save button is pressed
    firstname_box = (EditText) findViewById(R.id.fnamebox1);
    lastname_box = (EditText) findViewById(R.id.lnamebox);

    phone_box = (EditText) findViewById(R.id.phonebox);
    bio_box = (EditText) findViewById(R.id.bio1);
    gender_box = (Spinner) findViewById(R.id.Gender);

    currentuser.setGender(gender_box.getSelectedItem().toString());
    Log.d("gender check",currentuser.getGender());
    currentuser.setFirstname(firstname_box.getText().toString());
    currentuser.setLastname(lastname_box.getText().toString());
    currentuser.setPhone(phone_box.getText());


    update_user(currentuser);
}

// Need to figure out what to do about profession and intrests
public void update_user(user User){
    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(10);
    nameValuePairs.add(new BasicNameValuePair("firstname",User.getFirstname()));
    nameValuePairs.add(new BasicNameValuePair("lastname",User.getLastname()));
    nameValuePairs.add(new BasicNameValuePair("phone",User.getPhone()));
public类editprofile扩展活动{
公共最终静态字符串C_USER=“com.example.project2.CUSER”;
私人编辑文本名_框;
私人编辑文本lastname_框;
私有编辑文本用户名_框;
私人编辑文本邮箱;
私人编辑文本电话盒;
私人编辑文本框;
私人编辑文本框;
私人纺纱机;
私人复选框接受_呼叫;
私有静态用户currentuser;
创建时受保护的void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Intent=getIntent();
Bundle cu=intent.getExtras();
currentuser=cu.getParcelable(Getusers.CURRENT_USER);
setCurrentuser(currentuser);//真的不确定为什么需要这样做
Log.d(“创建了EDITPROFILE”,currentuser.getUsername());
setContentView(R.layout.fragment_editprofile);
填充_profile();
}
public void setCurrentuser(user currentuser){this.currentuser=currentuser;}
受保护的无效填充配置文件(){
firstname_box=(EditText)findViewById(R.id.fnamebox1);
lastname\u box=(EditText)findViewById(R.id.lnamebox);
phone_box=(EditText)findViewById(R.id.phonebox);
bio_box=(EditText)findViewById(R.id.bio1);
email\u box=(EditText)findViewById(R.id.email\u box);
性别盒=(微调器)findViewById(R.id.gender);
试一试{
firstname_box.setText(currentuser.getFirstname());
}
捕获(NullPointerException e){
firstname_box.setText(null);
}
lastname_box.setText(currentuser.getLastname());
Log.d(“phone_box”,currentuser.getPhone().toString());//这就是我得到奇怪输出的地方
phone_box.setText(currentuser.getFirstname());
bio_box.setText(currentuser.getBio());
email_box.setText(currentuser.getEmail());
}
公共作废保存(视图){//按下保存按钮时发生
firstname_box=(EditText)findViewById(R.id.fnamebox1);
lastname\u box=(EditText)findViewById(R.id.lnamebox);
phone_box=(EditText)findViewById(R.id.phonebox);
bio_box=(EditText)findViewById(R.id.bio1);
性别盒=(微调器)findViewById(R.id.gender);
currentuser.setGender(gender_box.getSelectedItem().toString());
Log.d(“性别检查”,currentuser.getGender());
currentuser.setFirstname(firstname_box.getText().toString());
currentuser.setLastname(lastname_box.getText().toString());
currentuser.setPhone(phone_box.getText());
更新用户(当前用户);
}
//需要弄清楚如何处理职业和兴趣
公共无效更新用户(用户用户){
List nameValuePairs=新的ArrayList(10);
添加(新的BasicNameValuePair(“firstname”,User.getFirstname());
添加(新的BasicNameValuePair(“lastname”,User.getLastname());
添加(新的BasicNameValuePair(“phone”,User.getPhone());

您得到的是什么输出?”“[04-11 20:47:31.347 84:0x78 I/AudioHardwareALSA]初始化的ALSA播放设备和IDPlayback\u扬声器\u正常”这是输出