×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    12

    How to catch Asha 501 Back button in LWUIT?

    Is there some LWUIT specific way to catch the back button of Asha 501 ?

    As a default it exits the application, but I would like to use it to step back inside the application.

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    603

    Re: How to catch Asha 501 Back button in LWUIT?

    Have you tried to add a command of back/exit type to the current Displayable and handle the code there?

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    12

    Re: How to catch Asha 501 Back button in LWUIT?

    Thanks for the answer. I added command to LWUIT Form I am using.

    Code:
    import com.sun.lwuit.Command;
    import com.sun.lwuit.Form;
    
    ...
    
            Command c = new Command("Back") {
                public void actionPerformed(ActionEvent evt) {
                      // do something
                }
           };
           form.addCommand(c);
           form.setBackCommand(c);

    Seems to work.

  4. #4
    Registered User
    Join Date
    Sep 2013
    Posts
    1

    Lightbulb Re: How to catch Asha 501 Back button in LWUIT?

    Hello,

    As long as I know in LWUIT you must use the following code to change the hardware back button functionality:

    Code:
    Form form = new Form("My form");
    ...
    Command back = new Command("Back"){
    	public void actionPerformed(ActionEvent evt) {
                    //your own back action
              }
    };
    form.setBackCommand(back);
    ...
    Regards!
    Luis

    P.S. I've just see that someone has posted the same answer, sorry for double post.
    Last edited by luis.razo; 2013-12-17 at 10:32. Reason: I've just see that someone has posted the same answer, sorry for double post.

Similar Threads

  1. Which LWUIT plugin for Asha SDK 1.0
    By bogus40 in forum Mobile Java UI and User Experience
    Replies: 5
    Last Post: 2013-07-06, 11:48
  2. Back Button In Nokia Asha
    By manikandan12 in forum Nokia Asha Web Apps
    Replies: 1
    Last Post: 2013-05-20, 16:42
  3. LWUIT- adding back command to button
    By herahadi in forum Mobile Java General
    Replies: 0
    Last Post: 2013-03-07, 08:53
  4. Replies: 14
    Last Post: 2012-12-06, 17:47
  5. Replies: 2
    Last Post: 2012-11-23, 07:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •