Amrita Stha Amrita Stha - 5 months ago 18
Android Question

Back Button command visible in android too

It sets the back Button in titlebar of ios

f.setBackCommand(new Command("News") {
}


Is there any way to display the back icon in android too just like in ios ?
Thankyou

Answer

Yes you can display back icon on android, use Toolbar API for this:

Toolbar t = new Toolbar();
f.setToolBar(t);
Command news = new Command("News", myIcon) {

    @Override
    public void actionPerformed(ActionEvent evt) {

    }
};
news.putClientProperty("uiid", "BackCommand");
f.setBackCommand(news);
t.addCommandToLeftBar(news);
t.setTitle("My Form");