Android. How to access a class from another file to MainActivity
<p>I created a separate java class called SetIP.java with just a simple print:</p>

<pre><code>package com.myname.appname;

import android.util.Log;

public class SetIP {

    public void hello(){
        Log.d("System", "Hello World!");
    }
}
</code></pre>

<p>In the MainActivity I try to call it by:</p>

<pre><code>public class MainActivity extends AppCompatActivity {

    SetIP setip = new SetIP();
    setip.hello();
   // OnCreate and Stuff
}
</code></pre>

<p>But the error said cannot resolve symbol 'Hello'. Please help. Thanks</p>