Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this is your main activity
- public class BluetoothTool extends Activity {
- // this is the static property
- // BluetoothConnection - is whatever class you use, doesn't matter for us
- public static BluetoothConnection btc;
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- btc = new BluetoothConnection();
- }
- }
- // this is another file, another activity,
- // but it can access directly static property of the main public
- public class MenuItem1Activity extends Activity {
- public someMethodWhereINeedBlueTooth(String stuffToSend) {
- BluetoothTool.btc.send(stuffToSend);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement