findViewById returns null inside handleMessage
<p>Little explanation, what i want to do necessary:
I need to update UI of my activity from another thread. But from that thread not accessible non-static functions/volumes, bcs without static i can't called code from outside class by PhonePadActivity.uaReceiverHandler(msg) manner (also from that thread static reference to Activity - PhonePadActivity.phonePadActvity always null and caused exception) . But when i passed in for using static handler, all static references also always null, which not gives me possibility to update UI (simple findViewByID product compiler error can't reference static method from non-static). So, only PhonePadActivity.uaReceiverHandler(msg) from another thread working, can change local private static variables, but can't access to view objects) How i can solve it?</p>

<p>i'm receive well message by handle message:</p>

<pre><code>public static final Handler uaReceiverHandler = new Handler(){

    @Override
    public void handleMessage(Message msg) {
        Bundle b = msg.getData();
        Log.e(THIS_FILE, "WAS regState" + regState);
        regState = b.getString("regState");  
        TextView statusLocal = (TextView) phonePadForUsing.findViewById(R.id.registrationStatus);

        statusLocal.setText("Registered");

    }
};
</code></pre>

<p>in my case: </p>

<pre><code>public  class PhonePadActivity extends Activity {
      public static PhonePadActivity phonePadForUsing;
      private static TextView status;
</code></pre>

<p>which assigned:</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_phone_pad);
    phonePadForUsing = this;
    status = ((TextView) phonePadForUsing.findViewById(R.id.registrationStatus));
</code></pre>

<p>This code working fine, regState is assigned as well, but phonePadForUsing always return null exemption, this code:</p>

<pre><code>        status.setText("Registered");
</code></pre>

<p>return full trace:</p>

<blockquote>
  <p>10-05 13:34:51.495: E/AndroidRuntime(12744):
  java.lang.NullPointerException 10-05 13:34:51.495:
  E/AndroidRuntime(12744):  at
  com.callsfreecalls.android.PhonePadActivity$4.handleMessage(PhonePadActivity.java:1180)
  10-05 13:34:51.495: E/AndroidRuntime(12744):  at
  android.os.Handler.dispatchMessage(Handler.java:99) 10-05
  13:34:51.495: E/AndroidRuntime(12744):    at
  android.os.Looper.loop(Looper.java:123) 10-05 13:34:51.495:
  E/AndroidRuntime(12744):  at
  android.app.ActivityThread.main(ActivityThread.java:4627) 10-05
  13:34:51.495: E/AndroidRuntime(12744):    at
  java.lang.reflect.Method.invokeNative(Native Method) 10-05
  13:34:51.495: E/AndroidRuntime(12744):    at
  java.lang.reflect.Method.invoke(Method.java:521) 10-05 13:34:51.495:
  E/AndroidRuntime(12744):  at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  10-05 13:34:51.495: E/AndroidRuntime(12744):  at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 10-05
  13:34:51.495: E/AndroidRuntime(12744):    at
  dalvik.system.NativeStart.main(Native Method)</p>
</blockquote>

<p>onCreate was fired before, so, all elements is already done, bcs i have log in OnCreate (as u see, it 10 seconds early than exception...:</p>

<blockquote>
  <p>10-05 13:34:41.535: D/PhonePad(12735): onCreate: created</p>
</blockquote>

<p>Any suggestion will appreciated, please include peace of code as well. Same code working well from another Handler which using from another class:</p>

<pre><code>final static Handler clientControllerHandler = new Handler(){
    @Override
    public void handleMessage(Message msg) {
        final TextView status = ((TextView) phonePadForUsing.findViewById(R.id.registrationStatus));
        status.setText("Data not received");
</code></pre>
