Is there a way to programmatically scroll a scroll view to a specific edit text?

I have a very long activity with a scrollview. It is a form with various fields that the user must fill in. I have a checkbox half way down my form, and when the user checks it I want to scroll to a specific part of the view. Is there any way to scroll to […]

Programmatically scroll to a specific position in an Android ListView

How can I programmatically scroll to a specific position in a ListView? For example, I have a String[] {A,B,C,D….}, and I need to set the top visible item of the ListView to the index 21 of my String[].

Android Studio – Ambiguous method call getClass()

I’m using Android Studio for my Android application. My code works and compiles. Recently, the IDE showes me error (red lines) on getClass of the following code: fragment.getClass().getSimpleName() But still the application compiles and runs. The error is: Ambiguous method call. Both getClass () in Object and getClass () in Object match. Can some one explain me […]

How do I get the dialer to open with phone number displayed?

I don’t need to call the phone number, I just need the dialer to open with the phone number already displayed. What Intent should I use to achieve this?

What is the 'app' Android XML namespace?

Here is an example of the app namespace that I’ve seen from a res/menu/main.xml file <menu xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” tools:context=”.MainActivity” > <item android:id=”@+id/action_settings” android:title=”@string/action_settings” android:orderInCategory=”100″ app:showAsAction=”never” /> </menu> What purpose does the app namespace serve? Is it a “standard” Android XML namespace? Are the same value options available for the same attribute placed in two […]

Accepting a certificate for HTTPs on Android

I’m trying to make Https connections on the Android phones, using HttpClient. Trouble is that since the certificate isn’t signed I keep getting “javax.net.ssl.SSLException: Not trusted server certificate”. Now I’ve seen a bunch of solutions where you simply accept all certificates, but what if I want to ask the user? I want to get a […]

Extending from two classes

How can I do this: public class Main extends ListActivity , ControlMenu Also, I would like to know that is this approach is okay that I have made the menus in class which is ControlMenu and I am extending in rest of the activities.

Add support library to Android Studio project

I just installed the new Android Studio and I’m looking for a way to import the support library for Android. Where is the option for that? In Eclipse that are just two clicks. I googled for it but found nothing. Surely it is too new.

No shadow by default on Toolbar?

I’m updating my app with the new Toolbar from the support library v21. My problem is that the toolbar does not cast any shadow if I don’t set the “elevation” attribute. Is that the normal behavior or I’m doing something wrong? My code is: <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical”> <android.support.v7.widget.Toolbar xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/my_awesome_toolbar” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”?attr/colorPrimary” […]

How to filter Android logcat by application?

This question already has an answer here: Filter LogCat to get only the messages from My Application in Android? 25 answers

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.