에서 객체 메소드를 호출 할 수 없습니다. 이 방법은 활성의 일부입니다내가이 간단한 SMS 리스너 클래스를 브로드 캐스트 청취자
public void addSMS(String sms_adress, String sms_date, String message)
{
LayoutParams lparams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
// from Number label
TextView from=new TextView(this);
from.setLayoutParams(lparams);
from.setBackgroundColor(Color.argb(200, 0, 0, 0));
from.setTextAppearance(getApplicationContext(), R.style.from_style);
from.setText(this.getString(R.string.label_from_sms)+":"+ sms_adress);
linearLayout.addView(from);
}
문제가이 라인에있다 : 널이 참조에
TextView from=new TextView(this);
.
나는 SMS 수신시 SMS가 실행중인 응용 프로그램의 SMS 목록을 업데이트한다는 것을 확인하려고합니다. 그것은 방송 수신기에서 활동 메서드를 호출 할 수없는 것 같습니다. 어느 누구도이 문제를 어떻게 해결할 수 있습니까?
실제로 문제는 여기에 없습니다. 청취자의 활동 방법을 호출하는 중입니다. – albanx
어떤 오류가 발생하고 있습니까? –
문맥을 얻는 것에 null 점 execption – albanx