Reputation: 10148
I have an Android activity called main.java and BPMClass.java class. I need to call the BPMClass.java within the main.java class. I wrote the code in the following way (does not show function name):
import com.app.BPMClass;
...
public class main extends Activity {
BPMClass bpmclass;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
bpmclass = new BPMClass("filename");
bpmclass. // does not show the function name of BPMClass.
}
}
....
BPMClass{
String fname;
public BPMClass(String filename){
fname=filename
}
public int fun1(fname){
int val=0;
.......
return val;
}
}
Upvotes: 2
Views: 15214
Reputation: 2346
problem is simple if he try to place class after name of the class
class BPMClass{
String fname;
public BPMClass(String filename){
fname=filename
}
public int fun1(fname){
int val=0;
.......
return val;
}
}
Upvotes: 0
Reputation: 3610
Declared access modifier of class as according to your need, if class needed to access from its package level, then this should work fine.. else declare it as public
Upvotes: 6