我的計劃是這樣的添加一個TextView到的TableRow
`
public class InfoWifiActivity<Intent> extends Activity {
TableRow tr;
TextView temp;
public void onCreate(Bundle savedInstanceState) {
wifi.startScan();
tr = new TableRow(this);
temp = new TextView(this);
IntentFilter i = new IntentFilter();
i.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
registerReceiver(new BroadcastReceiver(){
@Override
public void onReceive(Context context,
android.content.Intent intent) {
temp.setText("SSID");
temp.setPadding(0,0,3,0);
tr.addView(temp);
}
}
}, i);
}
}
`
但它一直FC當談到tr.addView(臨時);
任何人都可以幫助我嗎?在此先感謝。
logcat中的消息說什麼時它強制關閉什麼? – FoamyGuy
它沒有模擬器上的錯誤,因爲它不具有wifi數據。只有在我的移動設備上,它保持fc –
那麼logcat輸出在移動設備強制關閉時會顯示什麼? – FoamyGuy