+ Start a Discussion
Eric_SalesForceEric_SalesForce 

Custom Buttons to do a VisualForce page or a VisualForce mobile page

Hello,

I have a VisualForce page for users on their desktops and we recently created a mobile app that has some of the functionality but not all of the original. However I do not have a "new" button on the list view when looking at the mobile app and we already overrode the standard new button for the visualforce redirect. Is there a way to have a new button do two different things depending on if you are on mobile or not? Or have one new button show up and the other not depending if you are mobile or not?

thanks,
Ashish_SFDCAshish_SFDC
Hi Eric, 


Settings.Secure#ANDROID_ID returns the Android ID as an unique 64-bit hex string.

import android.provider.Settings.Secure;

private String android_id = Secure.getString(getContext().getContentResolver(),
                                                        Secure.ANDROID_ID);

http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id


With the ID and the OnClick event try of you can check the required condition. 

The Id can also be retrived for IOS as well. 

If you get one ID - then that id will be same for all other Same model Andriod devices. 

Try that else post an Idea in the Idea exchange


Regards,
Ashish