How do i resolve NullPointerException when calling methods?
问题 I'm a noob to android and i am having an issue calling a method from another class. The method works works fine when called from within its own class, but i get a nullpointerexception when i call it from another class. Any help would be greatly appreciated. Here is my code; Calling method in class1 from class2: BottlesActivity inst = new BottlesActivity(); inst.call0(); Method in class 1: public void call0() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri