How to get a value from a class for example

Here you need to get root value from oncreate

public class Inform extends Activity { public static final String EXTRA = "extra"; String root = syb; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detail); Intent intent = getIntent(); final String extra = intent.getStringExtra(EXTRA); syb = extra; } } 

    1 answer 1

    Remove the string String syb = "12"; word String . In general, you need to write there

     root = "12"; 

    And in the "top" String root = "" ; eg.

    • does not come out lit in red, now the code will update - Artem
    • @ Artem then post a compilation error message. - pavel
    • wrote like this changed above - Artem
    • @Artem the exact message that the compiler writes. - pavel
    • here write the link and : app: compileDebugJavaWithJavac FAILED - Artem