I have this method in Main activity:

```
 public void setPositionToView (Context ctx, List<Address> addresses) {
       try {

    String street = addresses.get(0).getAddressLine(0);
    String city = addresses.get(0).getAddressLine(1);
    String country = addresses.get(0).getAddressLine(2);

    Log.i(AppHelper.APP_LOG_NAMESPACE, street);

    // display toast message with success state
    Toast.makeText(ctx, "TEST", Toast.LENGTH_LONG).show();

    // change state text to success and colorize text green
    TextView eanTv = (TextView) findViewById(R.id.street);
    eanTv.setText("Test");
    //stateTv.setTextColor(getResources().getColor(R.color.green));

} catch (Exception e) {
    Log.e(AppHelper.APP_LOG_NAMESPACE, "getAndSavePosition method cannot be processed", e);
    e.printStackTrace();
        }
   }

```

Method is called as a callback from helper class (extended from Activity).

If in method i try to call:

```
TextView eanTv = (TextView) findViewById(R.id.street);

```

I got always null pointer exception, but if i try to call from onCreate method in Main activity method like this, is everything fine:

```
  public  void colorizeIt () {
        try {

            TextView stateTv = (TextView) findViewById(R.id.state);
            stateTv.setText("This is O.K");
        } catch (Exception e) {
            Log.e(AppHelper.APP_LOG_NAMESPACE, "getAndSavePosition method cannot be processed", e);
            e.printStackTrace();
        }
    }

```

I tried to find some solution for this but without luck, should i create some layout, view instance or something similar to example below?

```
LayoutInflater in = getLayoutInflater() ;
    View layout = in.inflate(R.layout.toast_layout, (ViewGroup) findViewById ( R.id.toast_layout_root ) ) ;

```

Thanks for any advice and example..