ABS ActionBar with custom view not working - actionbarsherlock

I wanted to create ActionBar with icons in center and I made it with getSupportActionBar().setCustomView(R.layout.abs_layout);. But there problems with events. when I click to ImageView onOptionsItemSelected not working.
Where is my mistake? Can I do this other ways?
there is my code:code_files
How can I add OnClickListener to the ImageViews

Related

How can i show spinner in titlebar when link is clicked on webview

Am new to android programming. I want to create a little spinner on my title bar in webview when a link is clicked. An example is the one in opera mini (on the top left) shown in this photo. Pls I'll really appreciate your help.
Implement toolbar with progress bar or spinner. Then setup javascriptInterface for your webview and update toolbar's spinner when it's called from webview.

Updating a listview inside Davigation Drawer

After thorough searching I still cannot find an answer.. So please help!!
I have a navigation drawer linked to an activity. The navigation drawer contains a listview inside it.
I need to update this listview by a Button click which is inside a fragment.
How do I do it?
(I also have a same navigation drawer and listview for different activities. So the listview should be updated in all the activities.)
Thanks in advance.

Is this layout possible to make, FadingActionBar w/ ViewPager?

I've got an layout which i really would like to use but I'm not sure it´s even possible!
I have tried FadingActionbar from github which works when I have a scrollview for content, but when I change to an ViewPager none of my fragments in it seems to load, and I¨m not able to swipe either to the sides or swipe up the top image.
My viewpager will consist of 3 views. One is an scrollview, and 2 of them are listviews.
I hope you understand what I want to achieve :) When swiping up I want the imageview to slide in under the actionbar and then stop when the PagerSlidingTabs are just under the acitonbar.
Mockup of what the layout looks like
This is the related github issue
https://github.com/ManuelPeinado/FadingActionBar/issues/23

Android: Dynamically adding textviews to a scrollview

I am working on an application that functions like a text messaging app. I am working on the layout of the app now. In the XML file I have an edit text on the top of the screen and one on the bottom of the screen. I want to dynamically create a scrollview that would be between the 2 edit texts. The scroll view would enable to scroll through multiple messages of the app. When I try to create the scrollview and textview dynamically it replaces the edittexts and they disappear.
So my question is how would I go about preventing the edittexts from disappearing and adding a scrollview in between the 2 edit texts ?
My code is like this:
ScrollView sv = new ScrollView(this);
LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
sv.addview(ll);
TextView tv = new TextView(this);
tv.setText("Dynamic layouts ftw!");
ll.addView(tv);
this.setContentView(sv);
What you are asking to do is build a ListView. ListView'ss have every function you require and more. Further, with the adapters, they are pretty quick. Here is a decent turorial on using ListViews.

Adding Arrow Picture in Android ListView

Is there any way to add an image to the right of Android's ListView. It needs to look similar to a type UITableView as shown in Removing the bar in standard UITableView programmatically
You can get an image to the right of the text on a row by putting the ListView, TextView and ImageView in a RelativeLayout and setting android:layout_alignParentLeft="true" for the TextView and android:layout_alignParentRight="true" for the ImageView. I have blogged about this here.

Resources