Using a share and random function with a ViewFlipper
My app has a few view flippers with 20-40 text strings in each. I have a previous and next buttons to cycle through the text strings. Is it possible to add a random and share button that will give you a random text string from the viewflipper the user is using. And if the user likes the specific textstring they are viewing, can that be shared with the ACTION_SEND method to Facebook, Twitter, etc?
I cannot find examples of a random or share from within a TextFlippe开发者_StackOverflowr! Please help!
You can certainly set a listener to your viewFlipper, but pushing that to facebook is a bit more complicated than a ACTION_SEND... you have to authenticate your app via an oAuth process to give your app permission to push to those social networks. Also, I imagine you can set a random number generator and open that index of the viewFlipper... pseudo code:
RandomNumber myRandom = new RandomNumber();
myRandom = myRandom % viewFlipper.size();
show viewFlipper[myRandom];
clearly this code wont work, merely pseudocode
精彩评论