Problem in Importing a Package

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Problem in Importing a Package

Postby Dliswa » Sun Oct 17, 2010 8:40 pm

Hi Everyone
Brother currently i m new to android and now i developing Gtalk Like
Application.
but when i import package i.e

import com.google.android.gtalkservices.IGTalkService;

IDE give me Error like Can not resolve .

What should i do.
Kindly plz Help me.
Dliswa
Developer
Developer
 
Posts: 30
Joined: Fri Oct 15, 2010 5:56 am

Top

Re: Problem in Importing a Package

Postby Sathasivan » Mon Oct 18, 2010 8:28 am

which IDE you are using??
User avatar
Sathasivan
Experienced Developer
Experienced Developer
 
Posts: 67
Joined: Wed Oct 14, 2009 7:51 am
Location: Chennai

Re: Problem in Importing a Package

Postby Dliswa » Mon Oct 18, 2010 2:55 pm

Eclipse
Dliswa
Developer
Developer
 
Posts: 30
Joined: Fri Oct 15, 2010 5:56 am

Re: Problem in Importing a Package

Postby Dliswa » Mon Oct 18, 2010 3:00 pm

Dear Sathasivan
When i Pressed Send My Location from Menu in my application .Runtime terminates my application by giving me an error.
error :The application Final Year Project (Process com.android.myproject) has Stopped Unexpectedly.please try again.
After that my appication is forcefully Terminated.



my Code is

package com.android.myproject;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class myActivity extends Activity {
/** Called when the activity is first created. */
private static final int MENU1 = Menu.FIRST;
private static final int MENU2 = Menu.FIRST + 1;
private static final int MENU3 = Menu.FIRST + 2;
private static final int MENU4 = Menu.FIRST + 3;
private static final int MENU5 = Menu.FIRST + 4;
private static final int MENU6 = Menu.FIRST + 5;
private static final int MENU7 = Menu.FIRST + 6;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Toast.makeText(myActivity.this,"MY First Toast", Toast.LENGTH_LONG).show();
}
public boolean onCreateOptionsMenu(Menu menu){

menu.add(0, MENU1, 0, "My location");
menu.add(0, MENU2, 0, "Send My Location");
menu.add(0, MENU3, 0, "Request Locaiton");
menu.add(0, MENU4, 0, "View Map");
menu.add(0, MENU5, 0, "Distance");
menu.add(0, MENU6, 0, "Remain Time");
menu.add(0, MENU7, 0, "Qiut");
return true;

}
public boolean onOptionsItemSelected(MenuItem menuitem){

switch(menuitem.getItemId()){

case MENU1:
//When My Location is Selected
launchMyLocationActivity();
return true;

case MENU2:
//When Send My Location is Selected
launchSendMyLocation();
return true;

case MENU3:
//When Request Location is Selected
launchRequestLocation();
return true;

case MENU4:
//When View Map is Selected
showMapView();
return true;

case MENU5:
//When Distance is Selected
RemainDistance();
return true;

case MENU6:
//When Time is Selected
DisplayRemainingTime();
return true;

case MENU7:
finish();
return true;
}
return false;

}
public void launchMyLocationActivity(){
Intent myLocationActivityLauncher = new Intent(this,MyLocationActivity.class);
startActivity(myLocationActivityLauncher);
}
public void launchRequestLocation(){
Intent requestlocationLauncher = new Intent(this, RequestLocation.class);
startActivity(requestlocationLauncher);
}
public void launchSendMyLocation(){
Intent launchSendMyLocationActivity = new Intent(this, SendMyLocation.class);
startActivity(launchSendMyLocationActivity);
}
public void DisplayRemainingTime(){
Toast.makeText(this, "Remain Time to Distinaiton", Toast.LENGTH_LONG).show();
}
public void RemainDistance(){
Toast.makeText(this, "Remaining Distance is =", Toast.LENGTH_LONG).show();

}
public void showMapView(){



}
}
Dliswa
Developer
Developer
 
Posts: 30
Joined: Fri Oct 15, 2010 5:56 am

Re: Problem in Importing a Package

Postby Dliswa » Mon Oct 18, 2010 3:01 pm

Dear i m using Eclipse as My IDE.
Dliswa
Developer
Developer
 
Posts: 30
Joined: Fri Oct 15, 2010 5:56 am

Re: Problem in Importing a Package

Postby Sathasivan » Tue Oct 19, 2010 8:17 am

hi,
i think the problem is in "MyLocationActivity" activity. Please make sure you have added this activity in your manifest.xml file.
User avatar
Sathasivan
Experienced Developer
Experienced Developer
 
Posts: 67
Joined: Wed Oct 14, 2009 7:51 am
Location: Chennai

Top

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests