현재 클래스를 다른 클래스로 리디렉션 한 후 메시지를 표시하려고합니다.이 코드 은 다른 클래스로 리디렉션하지 않고 메시지 만 표시합니다. 또한 별도의 Handler 클래스를 시도했지만, 하지만 일하지 않아. pls은 prbm을 해결하는 데 도움이됩니다.스레드 내 Intent 클래스를 호출 할 수 없습니다.
but.setOnClickListener(new View.OnClickListener()
{
public void onClick(final View v)
{
new Thread(new Runnable()
{
public void run()
{
try
{
/* sample code */
showToast();
}
catch (IOException e)
{
}
}
}
).start();
}
public void showToast() {
hd.post(new Runnable() {
public void run() {
Intent myIntent = new Intent(v.getContext(), List.class);
startActivity(myIntent);
Toast.makeText(getApplicationContext(),"Redirect to main menu", Toast.LENGTH_SHORT).show();
}
});
}
});
이 유'의도 myIntent = 새로운 의도 (Your_Current_Activity.this, List.class을) 시도가 다른 클래스 호출이 사용 핸들러를 할 수 없다 –
@ ρяσѕρєя K Ya ... Tnx 작품 ... –
이 작품 (잠시 동안), 여전히 좋은 생각이 아니에요. –