2014-09-19 3 views

답변

1
@Override 
protected void onHandleIntent(Intent arg0) { 
    Intent dialogIntent = new Intent(getBaseContext(), myActivity.class); 
    dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
    dialogIntent.putExtra("value", extras.getString("Notice")); 
    getApplication().startActivity(dialogIntent); 
} 
0
public class YourIntentService extends IntentService { 

    @Override 
    protected void onHandleIntent(Intent arg0) { 
     // TODO Auto-generated method stub 
     Intent intent = new Intent(this, YourNewActivity.class); 
     intent.putExtra("YourStringKey", "yourString"); 
     startActivity(intent); 
    } 

    public YourIntentService() { 
     super("YourIntentService"); 
    } 

} 

이것을 시도하십시오. 오해해서 미안해.

+0

내가 방송 수신기 – user3790145

+0

에서 activity.Not에 intentservice에서 데이터를 전송하려는 그 어떤 플래그가 그런 intent.addFlags'같은 그 플래그를 추가 – user3790145

+0

누락되는 오류 (Intent.FLAG_ACTIVITY_NEW_TASK를) 제공 ; ' –

0
public class MyIntentService extends IntentService { 

public MyIntentService() { 
    super(" MyIntentService"); 

} 

@Override 
protected void onHandleIntent(Intent arg0) { 
     String s=arg0.getExtras.getString("Notice") 
     Intent i = new Intent(this, yourActivity.class); 
     i.putExtra("Notice",s); 
     getApplication().startActivity(i); 
} 

} 
관련 문제