0
我轉換我的活動片段,該方法network_reinit_activity精細工作過,但是當我在片段中運行它,它不會,這是方法:方法曾在活動,但不是在一個片段
private final Context c = getActivity();
private void network_reinit_activity() {
new Thread(new Runnable() {
@Override
public void run() {
Activity mainAct = (Activity)c;
Intent new_i = new Intent(getActivity(), NavigationActivity.class);
mainAct.finish();
Intent srv_i = new Intent(c, RadioStreamService.class);
srv_i.putExtra("RS_STREAM_URL", RS_STREAM_URL);
getActivity().stopService(srv_i);
if(isInForeground)
// startActivity(new_i);
}
}).run();
}
謝謝你的幫助; – fayza
歡迎:) – Deepak