Android

Convert list array into array Charsequence for Dialog Android

10 Feb , 2014  

1
CharSequence[] cs = studentNames.toArray(new CharSequence[list.size()]);

Android

ListView showing only one results, do you use Scrollview ?

2 Feb , 2014  

Please remember not to use ListView under ScrollView since both view have “scroll” features. When you put ListView under ScrollView, the ListView will only showing one results.

You can use dynamic adding view / programmatically into ScrollView to make “List” format.
Some example :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
String[] statusConsultation = {"First data", "Second data", "Third data"};

LinearLayout statusLayout = (LinearLayout) view
                .findViewById(R.id.statusConsultationLayout);
statusLayout.removeAllViews();

for (int i = 0; i < statusConsultation.length; i++) {
    View childView = inflater.inflate(
            R.layout.status_fragment_list_layout, null);

    TextView statusDetailView = (TextView) childView
                    .findViewById(R.id.statusListDetailTextview);
    statusDetailView.setText(Html.fromHtml(statusConsultation[i]));

    statusLayout.addView(childView);
}

,

Android

Find SHA1 for Android Studio for Google API

1 Feb , 2014  

If we’re using ADT (Eclipse based), then we can find SHA1 keystore from Preferences. In Android Studio (IntelIJ), we couldn’t do that. We only can do manually :

1. Open your DOS
2. Go to “C:/Users/
3. Go to .android

4. Use keytool to retrieve keystore details by :

1
keytool -list -v -keystore debug.keystore

And you can find SHA1 results.