Posts

Showing posts from July, 2013

java.lang.OutOfMemoryError: thread creation failed

Image
07-24 00:26:16.176: E/AndroidRuntime(2621): java.lang.OutOfMemoryError: thread creation failed
07-24 00:26:16.176: E/AndroidRuntime(2621):     at java.lang.VMThread.create(Native Method)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at java.lang.Thread.start(Thread.java:1050)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at org.apache.http.impl.conn.tsccm.AbstractConnPool.enableConnectionGC(AbstractConnPool.java:140)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.createConnectionPool(ThreadSafeClientConnManager.java:120)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.<init>(ThreadSafeClientConnManager.java:98)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at com.loopj.android.http.AsyncHttpClient.<init>(AsyncHttpClient.java:133)
07-24 00:26:16.176: E/AndroidRuntime(2621):     at  com.rest.RestClient.<init>(RestClient.java:11)
07-24 00…

Regular expression for Email validation in java

Image
publicboolean validateEmail(String email) { if ((email != null) && email.matches("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@" + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$")) { returntrue; } returnfalse; }

URLEncoder.encoder(string) is depreciated

Image
URLEncoder.encoder(string)  ,URLEncoder.decoder(string) is depreciated.
Use URLEncoder.encoder(string ,string) instead.

Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1)

Image
07-17 02:09:05.021: A/libc(18457): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 18532 (pool-1-thread-1)

Android Alert Dialog

Image
Awesome Dialog



import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;

public class AwesomeDialog extends Activity {
    EditText etSearch;
    Button showDialog;
    Dialog dialog;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        showDialog = (Button) findViewById(R.id.show_dialog);
        showDialog.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                dialog = new Dialog(AwesomeDialog.this,
                        android.R.style.Theme_Translucent);
                dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

                dialog.setCancelable(true);
                dialog.setContentView(R.layout.dialog);
                Button done = (Bu…