Buggy code:
public class TaskDetail extends BaseActivity implements OnClickListener { private static final String TASK_DETAIL_URL = ( Constant . URL ) + "task//get_task.json" ; private static final String CANCEL_TASK_URL = ( Constant . URL ) + "task//cancel_task.json" ; private TextView tvTaskDetailNo ; private TextView tvTaskDetailName ; private TextView tvTaskDetailSex ; private TextView tvTaskDetailPhoneNo ; private TextView tvTaskDetailDate ; private TextView tvTaskDetailPeriod ; private TextView tvTaskDetailAddress ; private TextView tvTaskDetailComplete ; private Button btnTaskDetailCancel ; private Button btnTaskDetailOk ; private RequestQueue mQueue = null ; private JSONObject json = null ; public static void startTaskDetail ( Context context , String roomerNo , String roomerName , String roometSex , String roomerPhoneNo , String roomerHouseNo , String roomerDate , String roomerPeriod , String roomerRent , String roomerComplete , String roomerEmpNo , String roomerHouseCity , String roomerHouseAddress ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void init ( ) { tvTaskDetailNo = ( ( TextView ) ( findViewById ( tv_task_detail_no ) ) ) ; tvTaskDetailName = ( ( TextView ) ( findViewById ( tv_task_detail_name ) ) ) ; tvTaskDetailSex = ( ( TextView ) ( findViewById ( tv_task_detail_sex ) ) ) ; tvTaskDetailPhoneNo = ( ( TextView ) ( findViewById ( tv_task_detail_phone_no ) ) ) ; tvTaskDetailDate = ( ( TextView ) ( findViewById ( tv_task_detail_date ) ) ) ; tvTaskDetailPeriod = ( ( TextView ) ( findViewById ( tv_task_detail_period ) ) ) ; tvTaskDetailAddress = ( ( TextView ) ( findViewById ( tv_task_detail_address ) ) ) ; tvTaskDetailComplete = ( ( TextView ) ( findViewById ( tv_task_detail_complete ) ) ) ; btnTaskDetailCancel = ( ( Button ) ( findViewById ( btn_task_detail_cancel ) ) ) ; btnTaskDetailOk = ( ( Button ) ( findViewById ( btn_task_detail_ok ) ) ) ; Intent intent = getIntent ( ) ; Log . e ( "intent" , intent . toString ( ) ) ; tvTaskDetailNo . setText ( ( "客户编号：" + ( intent . getStringExtra ( "roomerNo" ) ) ) ) ; tvTaskDetailName . setText ( ( "客户姓名：" + ( intent . getStringExtra ( "roomerName" ) ) ) ) ; tvTaskDetailSex . setText ( ( "客户性别：" + ( intent . getStringExtra ( "roometSex" ) ) ) ) ; tvTaskDetailPhoneNo . setText ( ( "联系方式：" + ( intent . getStringExtra ( "roomerPhoneNo" ) ) ) ) ; tvTaskDetailDate . setText ( ( "看房日期：" + ( intent . getStringExtra ( "roomerDate" ) ) ) ) ; tvTaskDetailPeriod . setText ( ( "看房时间：" + ( Period . getString ( Integer . parseInt ( intent . getStringExtra ( "roomerPeriod" ) ) ) ) ) ) ; tvTaskDetailAddress . setText ( ( "详细地址：" + ( intent . getStringExtra ( "roomerHouseAddress" ) ) ) ) ; tvTaskDetailAddress . setOnClickListener ( this ) ; btnTaskDetailCancel . setOnClickListener ( this ) ; btnTaskDetailOk . setOnClickListener ( this ) ; if ( "" . equals ( intent . getStringExtra ( "roomerEmpNo" ) ) ) { btnTaskDetailCancel . setVisibility ( GONE ) ; } else { tvTaskDetailComplete . setVisibility ( VISIBLE ) ; if ( ( Integer . parseInt ( intent . getStringExtra ( "roomerComplete" ) . toString ( ) ) ) == 0 ) { tvTaskDetailComplete . setText ( "正在跟进中…" ) ; } else { tvTaskDetailComplete . setText ( "交易已完成！" ) ; btnTaskDetailCancel . setVisibility ( GONE ) ; btnTaskDetailOk . setVisibility ( GONE ) ; } btnTaskDetailOk . setVisibility ( GONE ) ; } try { json = new JSONObject ( ) ; <START_BUG> SharedPreferences sp = getSharedPreferences ( "OAEmpInfo" , MODE_PRIVATE ) ; <END_BUG> json . put ( "emp_no" , sp . getString ( "emp_no" , "" ) ) ; json . put ( "roomer_no" , intent . getStringExtra ( "roomerNo" ) ) ; json . put ( "roomer_house_no" , intent . getStringExtra ( "roomerHouseNo" ) ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } @ Override public void onClick ( View v ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
SharedPreferences sp = getSharedPreferences ( EMPINFO , MODE_PRIVATE ) ;