Take variable from a java file and display inside onCreate

Asked

Viewed 12 times

0

I’m trying to display a value in a Toast which is in a string, in another java file, only the error onCreate does not allow the value is undegistenting someone take a look at me Mainactivity.java

public class testes extends Activity
{
    public static void main(String[] args) {
    JASONRead n = new JASONRead();
    n.lerJson();
    }
    @Override
    protected void onCreate(Bundle savedIntanceState) {
        super.onCreate(savedIntanceState);
        setContentView(R.layout.json);
        n = this.lerJson();
        Toast.makeText(this, (n), Toast.LENGTH_SHORT).show();
    }
  • I want to display the value that is in (n) only it appears no value, but it has a value only that I cannot call the same.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.