static MainActivity ths;
@Overrideprotected void onCreate(Bundle savedInstanceState) {....ths = this;TextView showName = (TextView)findViewById(R.id.showName);
public static MainActivity getInstance() { return ths; }....public void updateTheTextView(final String t) {MainActivity.this.runOnUiThread(new Runnable() { public void run() { showName.append(t); } }); }}Others.java
欲使用MainActivity的texview就只要如下:
MainActivity.getInstance().updateTheTextView(strAddress);