By Binjam
on Fri, 06/21/2013 - 18:15
Hi,
i try to start to open a website with an button clicklistener:
Button web = (Button) this.findViewById(R.id.buttonss); web.setOnClickListener(new OnClickListener(){ public void onClick(View v) { Uri uriUrl = Uri.parse("website.com"); Intent launchBrowser = new Intent(Intent.ACTION_VIEW, uriUrl); startActivity(launchBrowser); } });
Did i have to put it in the ImageTargetsRenderer.java or anywhere else.
Tried a lot nothing works
Thanks
Android Button no virtuel button
Hi, make sure that your clickable view (button) is added on top of other views.
In ImageTargets.java, a good place where to add custom widgets is the mUILayout (you can find it in the code).
Android Button no virtuel button
Hi Alessandro,
i put it now in the ImageTarget.java
Android Button no virtuel button
Have you tried adding your button programmatically on top of the mUILayout ?
This should work (as I just verified):
Android Button no virtuel button
Thank you Alessandro,
Android Button no virtuel button
Great.
Android Button no virtuel button
Dear Al, and other member
I find this thread related to my case,
Android Button no virtuel button
this code is to show Toast in imagetarget.java , so how about to show Button ?
Android Button no virtuel button
Ok....
I mean from all of that, every change i make should be declare or initiate in imagetargetrendere. java ?
Android Button no virtuel button
Some changes need to be done in ImageTargetsRenderer (as explained in the article);
however, the Button should be added in the ImageTargets.java; then, from ImageTargetsRenderer you will need some method that calls to another method in ImageTargets.java to show/hide the button