package com.example.luke.sinhalasindu;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class HomePage extends Activity implements OnClickListener {
Button bntoartistpage;
Button bntonewmp3page;
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_page);
bntoartistpage = (Button) findViewById(R.id.bntoartistpage);
bntoartistpage.setOnClickListener(this);
bntonewmp3page = (Button) findViewById(R.id.bntonewmp3page);
bntonewmp3page.setOnClickListener(this);
}
#Override
public void onClick(View view) {
Intent inent = new Intent(this, Artist.class);
// calling an activity using <intent-filter> action name
// Intent inent = new Intent("com.example.luke.sinhalasindu");
startActivity(inent); }
#Override
public void onClick(View view){
Intent inent = new Intent(this, NewMp3.class);
// calling an activity using <intent-filter> action name
// Intent inent = new Intent("com.example.luke.sinhalasindu");
startActivity(inent); }
}
Button bntoartistpage = (Button) findViewById(R.id.bntoartistpage);
bntoartistpage.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Intent inent = new Intent(this, Artist.class);
// calling an activity using <intent-filter> action name
// Intent inent = new Intent("com.example.luke.sinhalasindu");
startActivity(inent);
}
});
Button bntonewmp3page = (Button) findViewById(R.id.bntonewmp3page);
bntonewmp3page.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Intent inent = new Intent(this, NewMp3.class);
// calling an activity using <intent-filter> action name
// Intent inent = new Intent("com.example.luke.sinhalasindu");
startActivity(inent);
}
});
You can't use two onClick() methods in one Activity. Use this
#Override
public void onClick(View view) {
if(view.getId() == R.id.bntoartistpage)
{
Intent inent = new Intent(this, Artist.class);
// calling an activity using <intent-filter> action name
// Intent inent = new Intent("com.example.luke.sinhalasindu");
startActivity(inent);
}
else if(view.getId() == R.id.bntonewmp3page)
{
Intent inent = new Intent(this, NewMp3.class);
// calling an activity using <intent-filter> action name
// Intent inent = new Intent("com.example.luke.sinhalasindu");
startActivity(inent);
}
}
Related
Activity crash on mobile, but on simulator works, whats wrong? Can anyone help me please?
Its a simple app that show some button than when clicked show a image.
6 Activity
Main Activity
package com.example.mobilejoy.kids1;
import android.content.Intent;
import android.media.MediaPlayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Transições de Cena
ImageButton toolbar2 = (ImageButton) findViewById(R.id.toolbarIcon2);
toolbar2.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(MainActivity.this,SecondActivity.class);
startActivity(myIntent);
finish();
}
});
ImageButton toolbar3 = (ImageButton) findViewById(R.id.toolbarIcon3);
toolbar3.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(MainActivity.this,ThirdActivity.class);
startActivity(myIntent);
finish();
}
});
ImageButton toolbar4 = (ImageButton) findViewById(R.id.toolbarIcon4);
toolbar4.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(MainActivity.this,FourthActivity.class);
startActivity(myIntent);
finish();
}
});
ImageButton toolbar5 = (ImageButton) findViewById(R.id.toolbarIcon5);
toolbar5.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(MainActivity.this,FifthActivity.class);
startActivity(myIntent);
finish();
}
});
ImageButton toolbar6 = (ImageButton) findViewById(R.id.toolbarIcon6);
toolbar6.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(MainActivity.this,SixthActivity.class);
startActivity(myIntent);
finish();
}
});
//Evento clicar botão executar audio
final MediaPlayer first121 = MediaPlayer.create(this, R.raw.first121);
ImageButton imageButton121 = (ImageButton) this.findViewById(R.id.imageButton121);
imageButton121.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
first121.start();
}
});
}
}
Second Activity
package com.example.mobilejoy.kids1;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageButton;
/**
* Created by mobilejoy on 9/13/16.
*/
public class SecondActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
//transição entre cenas
ImageButton toolbar1 = (ImageButton) findViewById(R.id.toolbarIcon1);
toolbar1.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(SecondActivity.this,MainActivity.class);
startActivity(myIntent);
finish();
}
});
ImageButton toolbar3 = (ImageButton) findViewById(R.id.toolbarIcon3);
toolbar3.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(SecondActivity.this,ThirdActivity.class);
startActivity(myIntent);
finish();
}
});
ImageButton toolbar4 = (ImageButton) findViewById(R.id.toolbarIcon4);
toolbar4.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(SecondActivity.this,FourthActivity.class);
startActivity(myIntent);
finish();
}
});
ImageButton toolbar5 = (ImageButton) findViewById(R.id.toolbarIcon5);
toolbar5.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(SecondActivity.this,FifthActivity.class);
startActivity(myIntent);
finish();
}
});
ImageButton toolbar6 = (ImageButton) findViewById(R.id.toolbarIcon6);
toolbar6.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent myIntent = new Intent(SecondActivity.this,SixthActivity.class);
startActivity(myIntent);
finish();
}
});
}
}
and the XML
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mobilejoy.kids1">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.example.mobilejoy.kids1.SecondActivity"></activity>
<activity android:name="com.example.mobilejoy.kids1.ThirdActivity"></activity>
<activity android:name="com.example.mobilejoy.kids1.FourthActivity"></activity>
<activity android:name="com.example.mobilejoy.kids1.FifthActivity"></activity>
<activity android:name="com.example.mobilejoy.kids1.SixthActivity"></activity>
</application>
</manifest>
End.
I'm not using any adapter. I have the position of items of a spinner. Not I have to get the string from the Item at the particular position. Its not selected item though. How can i get the item from the position value of item I have?
`package com.wordpress.ishansaysjava.advisingscheduler;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;
public class CourseListActivity extends Activity {
Button course1 ;
Button course2 ;
Button course3 ;
Button course4 ;
Button course5 ;
SharedPreferences sharedPreferences;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_course_list);
course1 = (Button) findViewById(R.id.course1);
course2 = (Button) findViewById(R.id.course2);
course3 = (Button) findViewById(R.id.course3);
course4 = (Button) findViewById(R.id.course4);
course5 = (Button) findViewById(R.id.course5);
sharedPreferences = getSharedPreferences("data", Context.MODE_PRIVATE);
course1.setText(sharedPreferences.getString("course1", "ADD A COURSE"));
course2.setText(sharedPreferences.getString("course2", "ADD A COURSE"));
course3.setText(sharedPreferences.getString("course3", "ADD A COURSE"));
course4.setText(sharedPreferences.getString("course4", "ADD A COURSE"));
course5.setText(sharedPreferences.getString("course5", "ADD A COURSE"));
}
public void addCourse (View view)
{
sharedPreferences = getSharedPreferences("data", Context.MODE_PRIVATE);
Spinner class_time = (Spinner) findViewById(R.id.class_time);
Spinner lab_time = (Spinner) findViewById(R.id.lab_time);
if(view.getId() == R.id.course1)
{
if(course1.getText().toString().equals("ADD A COURSE"))
{
Intent intent = new Intent(this, AddCourseActivity.class);
intent.putExtra("list_pos", R.id.course1);
startActivity(intent);
}
else
{
Intent intent = new Intent(this, CourseActivity.class);
intent.putExtra("class_time", class_time.getItemAtPosition(sharedPreferences.getInt("class1", 0)).toString());
Log.i("classtime", (String)class_time.getItemAtPosition(3));
intent.putExtra("lab_time", lab_time.getItemAtPosition(sharedPreferences.getInt("lab1", 0)).toString());
startActivity(intent);
}
}
if(view.getId() == R.id.course2)
{
if(course2.getText().toString().equals("ADD A COURSE"))
{
Intent intent = new Intent(this, AddCourseActivity.class);
intent.putExtra("list_pos", R.id.course2);
startActivity(intent);
}
else
{
Intent intent = new Intent(this, CourseActivity.class);
startActivity(intent);
}
}
if(view.getId() == R.id.course3)
{
if(course3.getText().toString().equals("ADD A COURSE"))
{
Intent intent = new Intent(this, AddCourseActivity.class);
intent.putExtra("list_pos", R.id.course3);
startActivity(intent);
}
else
{
Intent intent = new Intent(this, CourseActivity.class);
startActivity(intent);
}
}
if(view.getId() == R.id.course4)
{
if(course4.getText().toString().equals("ADD A COURSE"))
{
Intent intent = new Intent(this, AddCourseActivity.class);
intent.putExtra("list_pos", R.id.course4);
startActivity(intent);
}
else
{
Intent intent = new Intent(this, CourseActivity.class);
startActivity(intent);
}
}
if(view.getId() == R.id.course5)
{
if(course5.getText().toString().equals("ADD A COURSE"))
{
Intent intent = new Intent(this, AddCourseActivity.class);
intent.putExtra("list_pos", R.id.course5);
startActivity(intent);
}
else
{
Intent intent = new Intent(this, CourseActivity.class);
startActivity(intent);
}
}
}
}
`
I think the problem is in sharedPreferences.getInt("lab1", 0) inside spinner.getItemtAtPosition() function.
Try to debug the app and check what integer value it is returning or set the value obtained from sharedPreferences.getInt("lab1", 0) in log and check logcat.
I'm trying to make a simple math game with two modes, addition and subtraction. I figured out how to create a button that will link the "Addition button" to the addition activity but I can't seem to figure out how to create a second "Subtraction Button" that will link to the subtraction activity. Here's my broken code:
package com.example.kirky_000.madmath;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;
import android.content.Context;
import android.content.Intent;
public class MainMenu extends ActionBarActivity {
Button button;
Button button2;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_menu);
addListenerOnButton();
}
public void addListenerOnButton() {
final Context context = this;
button = (Button) findViewById(R.id.button);
button2 = (Button) findViewById(R.id.button2);
button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
Intent intent = new Intent(context, Addition.class);
startActivity(intent);
}
button2.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
Intent intent = new Intent(context, Subtraction.class);
startActivity(intent);
}
});
}
Your code just have some syntax error which is solved as per given code...
package com.example.kirky_000.madmath;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;
import android.content.Context;
import android.content.Intent;
public class MainMenu extends ActionBarActivity {
Button button;
Button button2;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_menu);
addListenerOnButton();
}
public void addListenerOnButton() {
final Context context = this;
button = (Button) findViewById(R.id.button);
button2 = (Button) findViewById(R.id.button2);
button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
Intent intent = new Intent(context, Addition.class);
startActivity(intent);
}
});
button2.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
Intent intent = new Intent(context, Subtraction.class);
startActivity(intent);
}
});
}
}
Your second instruction to add listener is inside the first OnClickListener.
So the listener is never added to the second button. You code should be like this :
public void addListenerOnButton() {
final Context context = this;
button = (Button) findViewById(R.id.button);
button2 = (Button) findViewById(R.id.button2);
button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
Intent intent = new Intent(context, Addition.class);
startActivity(intent);
}
});
button2.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
Intent intent = new Intent(context, Subtraction.class);
startActivity(intent);
});
}
You need to have different click listeners for different buttons. Right now, you're putting the click listener for the second button inside the click listener for the first button. Separate them like this..
button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
Intent intent = new Intent(context, Addition.class);
startActivity(intent);
}
});
button2.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
Intent intent = new Intent(context, Subtraction.class);
startActivity(intent);
}
)};
Some points before the solution (those will help you for further coding).
Declare context after buttons declaration : So after Button
button, button2, write :
final Context context;
Always keep in mind : Always initialize objects in onCreate()
method. So in OnCreate() after
setContentView(R.layout.activity_main_menu);, write :
button = (Button) findViewById(R.id.button);
button2 = (Button) findViewById(R.id.button2);
//then define context
context = MainMenu.this;
//or context = getApplicationContext();
Now addListenerOnButton() function will be like this (just replace
addListenerOnButton() with following code):
public void addListenerOnButton(){
button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent = new Intent(context, Addition.class);
startActivity(intent);
}
});
button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent = new Intent(context, Subtraction.class);
startActivity(intent);
}
});
}
Now what is the wong in your code ?
Your onClick listener code is wrong...
enjoy the coding :) (and android :))...
you can even do like this
public void mainClickHandler(View v)
{
switch (v.getId()) {
case R.id.button:
Intent intent = new Intent(context, Addition.class);
startActivity(intent);
case R.id.button2:
Intent intent = new Intent(context, Subtraction.class);
startActivity(intent);
}
}
Pease help me with my code.
When i click any button, button1, button2 or button3 opens new activity, but layout is empty, without any text's and others.
Code of activity from calling the new activity:
package com.novator.inweld;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class TentsCatalog extends Activity implements OnClickListener
{
private Button button1;
private Button button2;
private Button button3;
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.tents_catalog);
button1 = (Button)findViewById(R.id.button1);
button2 = (Button)findViewById(R.id.button2);
button3 = (Button)findViewById(R.id.button3);
button1.setOnClickListener(this);
button2.setOnClickListener(this);
button3.setOnClickListener(this);
}
#Override
public void onClick(View view)
{
if(view == button1)
{
Intent intent = new Intent(this, TentPage.class);
intent.putExtra("tentId", "1");
startActivity(intent);
}
if(view == button2)
{
Intent intent = new Intent(this, TentPage.class);
intent.putExtra("tentId", "2");
startActivity(intent);
}
if(view == button3)
{
Intent intent = new Intent(this, TentPage.class);
intent.putExtra("tentId", "3");
startActivity(intent);
}
}
}
Code of my new activity:
package com.novator.inweld;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class TentPage extends Activity
{
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Intent intent= getIntent();
String tentId = intent.getStringExtra("tentId");
if(tentId == "1")
{
setContentView(R.layout.tent1);
}
if(tentId == "2")
{
setContentView(R.layout.tent2);
}
if(tentId == "3")
{
setContentView(R.layout.tent3);
}
}
}
use equals(), not ==
if(tentId.equals("1"))
change onClick method with:
#Override
public void onClick(View v)
{
Intent intent = new Intent(this, TentPage.class);
switch (v.getId()) {
case R.id.button1:
intent.putExtra("tentId", "1");
startActivity(intent);
break;
case R.id.button2:
intent.putExtra("tentId", "2");
startActivity(intent);
break;
case R.id.button3:
intent.putExtra("tentId", "3");
startActivity(intent);
break;
default:
break;
}
and use tentId.equals(""); for String check you must use equals() method and for number value use == like:
if(tentId.equals("1"))
{
setContentView(R.layout.tent1);
}
if(tentId.equals("2"))
{
setContentView(R.layout.tent2);
}
if(tentId.equals("3"))
{
setContentView(R.layout.tent3);
}
Java is a b*%$#ch... Use equals():
if(tentId.equals("1")) ...
Also, according to this answer, Android supports Java 1.7's strings in switch statements, meaning you can rewrite your code in a tidier fashion:
switch(tendId) {
case "1": ...
case "2": ...
case "3": ...
}
Keep in mind that the simplest solution would be to pass tendId as an int and not a string:
intent.putExtra("tendId", 1);
int tendId = intent.getIntExtra("tendId");
Replace your TentPage like:
package com.novator.inweld;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class TentPage extends Activity
{
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Intent intent= getIntent();
String tentId = intent.getStringExtra("tentId");
if(tentId.equals("1"))
{
setContentView(R.layout.tent1);
}
if(tentId.equals("2"))
{
setContentView(R.layout.tent2);
}
if(tentId.equals("3"))
{
setContentView(R.layout.tent3);
}
}
}
Hey I am trying to get different buttons to open up different pages in a android project but only on of the buttons is opening up a new page.
I am new to programming so my terminology may not be correct but I was following a youtube tutorial and it showed how to create a button and make it open up a new page. I tried to do this for multiple buttons but I think I am making the mistake in the main activity. Sorry if I haven't provided the write information to help me solve the problem.
package test.activity.today;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class ActivityTutorialActivity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button next = (Button) findViewById(R.id.next_button);
next.setOnClickListener(new OnClickListener(){
public void onClick (View v){
Intent myIntent = new Intent(v.getContext(), NextActivity.class);
v.getContext().startActivity(myIntent);
}
});
}
public void onCreate1(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button next = (Button) findViewById(R.id.question_button);
next.setOnClickListener(new OnClickListener(){
public void onClick (View v){
Intent myIntent = new Intent(v.getContext(), Question.class);
v.getContext().startActivity(myIntent);
}
});
}
public void onCreate2(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button next = (Button) findViewById(R.id.owner_cost);
next.setOnClickListener(new OnClickListener(){
public void onClick (View v){
Intent myIntent = new Intent(v.getContext(), Owner.class);
v.getContext().startActivity(myIntent);
}
});
}
}
you should only have one onCreate() method.. check android activity's life cycle to understand it
package test.activity.today;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class ActivityTutorialActivity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button next = (Button) findViewById(R.id.next_button);
next.setOnClickListener(new OnClickListener(){
public void onClick (View v){
Intent myIntent = new Intent(v.getContext(), NextActivity.class);
v.getContext().startActivity(myIntent);
}
});
Button question = (Button) findViewById(R.id.question_button);
question.setOnClickListener(new OnClickListener(){
public void onClick (View v){
Intent myIntent = new Intent(v.getContext(), Question.class);
v.getContext().startActivity(myIntent);
}
});
Button ownerCost = (Button) findViewById(R.id.owner_cost);
ownerCost.setOnClickListener(new OnClickListener(){
public void onClick (View v){
Intent myIntent = new Intent(v.getContext(), Owner.class);
v.getContext().startActivity(myIntent);
}
});
}
}
You are duplicating the onCreate() method... this method is called natively by Android and, thus, none of your other methods will get called (you'd have other problems if they were). To create more than one button, you need to add new buttons to your layout and then add them to onCreate().
There is another way to implement the onClick.
In your layout you can specify the function to call onClick
<ImageButton
android:id="#+id/imageButtonNext1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="#color/back_color"
android:onClick="RegistraterCompanyOnClick"
android:src="#drawable/ic_next" />
Then in your activity you can filter which button by it's ID. See below.
public void RegistraterCompanyOnClick(View v){
switch(v.getId()){
case R.id.imageButtonNext1:
String cname = company.getText().toString();
if (cname.length()== 0){
message = getString(R.string.company_required);
ShowDialog(message);
}
else{
company_name = company.getText().toString();
VerifyClient(company_name);
}
break;
case R.id.imageButtonInfo1:
//message = getString(R.string.registration_info);
message = "Device ID:\n" + deviceID;
// TODO Auto-generated method stub
ShowDialog(message);
break;
case R.id.imageButtonHelp1:
message = getString(R.string.registration_contact);
// TODO Auto-generated method stub
ShowDialog(message);
break;
case R.id.imageButtonPrevious1:
Intent resultIntent = new Intent();
// TODO Auto-generated method stub
resultIntent.putExtra("company_name", company.getText().toString());
resultIntent.putExtra("company_id", companyID);
resultIntent.putExtra("location_name", location_name);
resultIntent.putExtra("location_id", locationID);
setResult(Activity.RESULT_CANCELED, resultIntent);
finish();
default:
break;
}
}