H hunter3424 Member Aug 4, 2013 #1 hello all i put 40 buttons in a layout and now i want to everyone of them show a text file in another activity. i dont know how to do this with one activity,i dont want to make 40 activities and layouts. can anyone help me plz??
hello all i put 40 buttons in a layout and now i want to everyone of them show a text file in another activity. i dont know how to do this with one activity,i dont want to make 40 activities and layouts. can anyone help me plz??
D devlei Active Member Licensed User Longtime User Aug 4, 2013 #2 Use a Process Global variable in your first Activity and assign it a value depending on which button was clicked. Then use one other activity and depending on the value of the Process Global variable a different file can be used and displayed. This way you only need one other Activity and Layout. Remember to prefix the Process Global variable with the Module name in which it was declared when using it in other modules. (eg Main.pgButtonClicked) Upvote 0
Use a Process Global variable in your first Activity and assign it a value depending on which button was clicked. Then use one other activity and depending on the value of the Process Global variable a different file can be used and displayed. This way you only need one other Activity and Layout. Remember to prefix the Process Global variable with the Module name in which it was declared when using it in other modules. (eg Main.pgButtonClicked)
Erel B4X founder Staff member Licensed User Longtime User Aug 5, 2013 #4 You can also use CallSubDelayed for that: http://www.b4x.com/android/forum/posts/107282/ Upvote 0