我的程序是这样的
`
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 );
}
}
`
但是当涉及到 tr.addView(temp);
任何人都可以帮助我吗?在此先感谢。