Technical Knowledge

technical knowledge is that type of blogger in which you can find all the soluctions of your problems which you cannot solve you can see the video given on this blog and solve your problem by yourself.

Like us on Facebook

Technical Knowledge
Showing posts with label Custom. Show all posts
Showing posts with label Custom. Show all posts

Sunday, March 29, 2015

Custom dialog to take user log in credentials: Android tutorial

Program description:

This program will show how to create a custom dialog which contains 2 edit text boxes to take log in and pass word credentials from user.


First Activity
package com.techpalle.b15_dialogassign;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity {
Button b;
EditText e1, e2;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b = (Button) findViewById(R.id.button1);
e1 = (EditText) findViewById(R.id.editText1);
e2 = (EditText) findViewById(R.id.editText2);
b.setOnClickListener(new android.view.View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
showDialog(1);
}
});
}

@Override
protected Dialog onCreateDialog(int id) {
Dialog d = null;
switch(id){
case 1:
AlertDialog.Builder ab = new AlertDialog.Builder(this);
ab.setTitle("Enter user credentials");
ab.setView(getLayoutInflater().
inflate(R.layout.dialog, null));
ab.setPositiveButton("Done", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Dialog d = (Dialog) dialog;
EditText x = (EditText) d.findViewById(R.id.editText1);
EditText y = (EditText) d.findViewById(R.id.editText2);
e1.setText(x.getText().toString());
e2.setText(y.getText().toString());
}
});
d = ab.create();
break;
}
return d;
}

}
xml layout file for First Activity 
File name: activity_main.xml

  xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_toRightOf="@+id/textView1"
android:ems="10" >


android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/editText1"
android:ems="10" />



custom xml layout file for Dialog to show log in and password.
File name: dialog.xml

  
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" >


android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />



Download complete code : Click to download

More  programs on dialogs:
android Dialogs(alert dialog, datepicker dialog, time picker dialog, progress dialog) tutorial

Tags: android, tutorial, examples, Custom dialog, login dialog, user input dialog

Monday, March 23, 2015

Custom dialog to take user log in credentials: Android tutorial

Program description:

This program will show how to create a custom dialog which contains 2 edit text boxes to take log in and pass word credentials from user.


First Activity
package com.techpalle.b15_dialogassign;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity {
Button b;
EditText e1, e2;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b = (Button) findViewById(R.id.button1);
e1 = (EditText) findViewById(R.id.editText1);
e2 = (EditText) findViewById(R.id.editText2);
b.setOnClickListener(new android.view.View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
showDialog(1);
}
});
}

@Override
protected Dialog onCreateDialog(int id) {
Dialog d = null;
switch(id){
case 1:
AlertDialog.Builder ab = new AlertDialog.Builder(this);
ab.setTitle("Enter user credentials");
ab.setView(getLayoutInflater().
inflate(R.layout.dialog, null));
ab.setPositiveButton("Done", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Dialog d = (Dialog) dialog;
EditText x = (EditText) d.findViewById(R.id.editText1);
EditText y = (EditText) d.findViewById(R.id.editText2);
e1.setText(x.getText().toString());
e2.setText(y.getText().toString());
}
});
d = ab.create();
break;
}
return d;
}

}
xml layout file for First Activity 
File name: activity_main.xml

  xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_toRightOf="@+id/textView1"
android:ems="10" >


android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/editText1"
android:ems="10" />



custom xml layout file for Dialog to show log in and password.
File name: dialog.xml

  
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" >


android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />



Download complete code : Click to download

More  programs on dialogs:
android Dialogs(alert dialog, datepicker dialog, time picker dialog, progress dialog) tutorial

Tags: android, tutorial, examples, Custom dialog, login dialog, user input dialog

Monday, December 1, 2014

[Ꮊ] Toyota Corolla Custom Fit All Weather Rubber

Toyota Corolla Custom Fit All Weather Rubber

Toyota Corolla Custom Fit All Weather Rubber-imageYes we have a guide for buy this product follow me now.
New!!! Buy Toyota Corolla Custom Fit All Weather Rubber Reviews. Check Price And See Full Description and Customer Review.

>>> Click here to & Full Information Read Customer Review.

Are you looking for a Tools Watch like this., I highly recommend this Toyota Corolla Custom Fit All Weather Rubber to you.It's great for me. And may be good for you. I use it and it's ok for me and my work. It is a good help for me to run faster.I used it worked perfectly. It is durable. Handy I like this Toyota Corolla Custom Fit All Weather Rubber. My kids love it and do it.I bought it from Amazon because it was on sale.I can buy price on the cheap.It is priced quite high, but I'm sure it's worth the money to buy it. These Tools Watch that I can repair and rebuild. As well.I would recommend buying the Toyota Corolla Custom Fit All Weather Rubber they use today. And it is ready product Samsung Washers, Custom Range Hoods, Electrolux Microwave for you