Back button how to get rid of Activity stack without finishing

I have problem with back button on phone – I have back button in application which need to go to history, but same thing shouldn’t do phone’s hardware button. This solves my issue:

Slides which are really helpful about backstack:

SimpleAdapter and Spanned from Html.fromHtml

In TextView which is part of ListView and SimpleAdapter the HTML tags are stripped, the solution is to add ViewBinder:

adapter.setViewBinder(new SimpleAdapter.ViewBinder() {
	public boolean setViewValue(View view, Object data, String textRepresentation) {
		if (data instanceof Spanned && view instanceof TextView) {
			((TextView) view).setText((Spanned) data);
		} else {
			((TextView) view).setText(String.valueOf(data));
		return true;

More links

ArrayAdapter suitable for ImageView:

Links of today

Transparent background of ListView after scroll:

Useful links of today

Push Notifications for Android 2.2+:
Emulator Google Map error when no API is downloaded for VMD:
Sample code to draw route between two POIs:
Example of reading GPS location (with listener):
Smooth polylines from Maps API:

Simple QR code checking

This is scanning through the Intent – you need zxing library from and Barcode Scanner from Market installed. After clicking button you are redirected to Barcode Scanner, which returns scanning result to Activity.

package com.example;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class QRCodeTestActivity extends Activity
    public void onCreate(Bundle savedInstanceState)
        Button qrButton = (Button) findViewById(;
        View.OnClickListener l;
        qrButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                IntentIntegrator integrator = new IntentIntegrator(QRCodeTestActivity.this);

    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
        IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
        if (scanResult != null) {
            Toast.makeText(getApplicationContext(), "resultCode: " + resultCode + " -> " + scanResult.getContents() + " " + scanResult.getFormatName(), Toast.LENGTH_LONG).show();

Android free ebooks

There are already a lot of free ebooks which allow to start learning Android:

Learning Android
Android Application Development from A to Z
android design guidelines

Game engines

I was looking for the game engines for a 2D games in Android, and some Live Wallpaper helpers and I found a list of engines here:

For now I have tested two of them: libgdx and AndEngine. AndEngine is pretty cool but I’m not sure what will happen to it when the main developer left it for Zynga. Yes, I see that he is still commiting, so I hope he will still work on this OS engine.

Live Wallpaper extension is also really cool.


public class TestHighlight {

	public void highlight() {



Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress