1

I want to start another apps when I click this button.

sharebtn = new Custom_ButtonField(share, shareactive, shareactive) {
            protected boolean navigationClick(int status, int time) {
                //I want to start another apps (Strawberry)
                return true;
            }
        };
        add(sharebtn);

Here is the Strawberry Apps

public class StrawBerry extends UiApplication implements ActionListener {

public static void main(String url) {
    new StrawBerry(url).enterEventDispatcher();
}
}

I want to pass String url to Strawberry apps. How can I achieve this?

Alan Lai
  • 1,296
  • 2
  • 12
  • 16

1 Answers1

2

First your main method won't be never called by system. The right signature:

public static void main(String[] arguments){}

Take a look on this article to launch another app with parameters : How To - Launch a third-party application from another third-party application

To post on FB page. You need something like:

private final String NEXT_URL = "http://www.facebook.com/connect/login_success.html";
private final String APPLICATION_ID = "your id";
private final String APPLICATION_SECRET = "your secret";
private Facebook fb;
private User user;
...
fb = Facebook.getInstance(new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, Facebook.Permissions.PUBLISH_STREAM));
user = fb.getUser(pUserId);
user.publishPost(messageEditField.getText(), linkEditField.getText(), pictureEditField.getText(), nameEditField.getText(), captionEditField.getText(), descriptionEditField.getText(), sourceEditField.getText());
Eugen Martynov
  • 19,888
  • 10
  • 61
  • 114