pancakeleh
Lurker
hi guys, i experience this error ActivityTHread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2496(source not found) when i try to run the application. It is an application for displaying 3 buttons on the main activity page. Anyone know whats the solution to it? is it something to do with the onClickLIstener events?
the code as follow:
package net.learn2develop.IntentLab;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class IntentLab extends Activity {
Button b1, b2, b3;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Web Browser Button
b1 = (Button) findViewById(R.id.btn_webbrowser);
b1.setOnClickListener (new OnClickListener()
{
public void onClick (View arg0){
Intent i = new
Intent (android.content.Intent.ACTION_VIEW, Uri.parse("Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more"));
startActivity(i);
}
});
//show map button
b2 = (Button) findViewById(R.id.btn_showmap);
b2.setOnClickListener (new OnClickListener()
{
public void onClick (View arg0){
Intent i = new
Intent (android.content.Intent.ACTION_VIEW, Uri.parse("geo:37.827500, -122.481670"));
startActivity(i);
}
});
//make calls button
b3 = (Button) findViewById(R.id.btn_makecalls);
b3.setOnClickListener (new OnClickListener()
{
public void onClick (View arg0){
Intent i = new
Intent (android.content.Intent.ACTION_DIAL, Uri.parse("tel: +651234567"));
startActivity(i);
}
});
}
}
the code as follow:
package net.learn2develop.IntentLab;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class IntentLab extends Activity {
Button b1, b2, b3;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//Web Browser Button
b1 = (Button) findViewById(R.id.btn_webbrowser);
b1.setOnClickListener (new OnClickListener()
{
public void onClick (View arg0){
Intent i = new
Intent (android.content.Intent.ACTION_VIEW, Uri.parse("Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more"));
startActivity(i);
}
});
//show map button
b2 = (Button) findViewById(R.id.btn_showmap);
b2.setOnClickListener (new OnClickListener()
{
public void onClick (View arg0){
Intent i = new
Intent (android.content.Intent.ACTION_VIEW, Uri.parse("geo:37.827500, -122.481670"));
startActivity(i);
}
});
//make calls button
b3 = (Button) findViewById(R.id.btn_makecalls);
b3.setOnClickListener (new OnClickListener()
{
public void onClick (View arg0){
Intent i = new
Intent (android.content.Intent.ACTION_DIAL, Uri.parse("tel: +651234567"));
startActivity(i);
}
});
}
}