Gido
Gido

Reputation: 75

Android actionBar OnClick()

This may be a odd question, but I want a handler to handle a click on the actionbar, This because I use a background to draw the Icon/logo combination because it doesn't fit right when I use the build in methods.

This results in not having an Icon or logo which you can click to go to the home activity, which I want when you click the actionbar.

I tried a lot of things, making the logo/icon invisible and other things but I can't figure out how to get it to work. Any ideas?

The actionbar looks like this:

    final ActionBar actionBar = getActionBar(); 
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);

    Bitmap bm = UnscaledBitmapLoader.loadFromResource(getResources(), R.drawable.logo, null);
    BitmapDrawable background = new BitmapDrawable(this.getResources(), bm);
    background.setTileModeX(android.graphics.Shader.TileMode.CLAMP); 
    actionBar.setBackgroundDrawable(background);

The bitmaploader doesn't do anything special which would prevent it. How to I get a onclick listener for the actionbar?

Upvotes: 1

Views: 1041

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006594

How to I get a onclick listener for the actionbar?

That is not supported, sorry.

This because I use a background to draw the Icon/logo combination because it doesn't fit right when I use the build in methods.

It works for everybody else. Perhaps you should consider asking a different question on SO on this topic, with screenshots to illustrate your problem.

Upvotes: 1

Related Questions