Problems with start a Map Activity from other Activity

by Carlos Moreira » Wed, 14 Apr 2010 03:03:42 GMT


Sponsored Links
 Hello every one!

It's my first time mailing for a solution, I hope find the solution
for this...

Any way, I am developing an aplication. This one is designed to login
a user, then select how find a place, using simple data or using a
map. When I try to set in the event OnClick for select the "Map
way" (using intent):

startActivity(new Intent(getApplicationContext(),
MapviewController.class));

I have problems and didn't work.

My class and manifest are:

public class MapviewController extends MapActivity {

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

            //Definicin del mapa a usar en la vista
            MapView mapView = (MapView) findViewById(R.id.map_view);
            mapView.setBuiltInZoomControls(true);
            mapView.setSatellite(true);


-----

<application android:label="@string/app_name" android:icon="@drawable/
sitefinder">
        <activity android:name=".LoginController"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
                <activity android:name=".ElegirARMapsController"
                  android:label="@string/app_name">
            <intent-filter>

            </intent-filter>
        </activity>
        <activity android:name=".MapviewController"
                  android:label="@string/app_name"
                  android:theme="@android:style/Theme.NoTitleBar">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category
android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>

-------------

Do you know any way to call the MapActivity from other?

Thx a lot for read this and trying to help me.

PD:Sry for my English!

Carlos J. Moreira Muoz

--



Other Threads

1. How to fire a dialog from custom list adapter?

Hi,
I'm in trouble to fire dialog from custom list adapter.
The list item consists of 2 TextView and 1 ImageView. It's similar to
the Android phone's account setting
(http://developer.android.com/resources/samples/images/
SampleSyncAdapter1.png)

I remember that the dialogs are only invoked in Activity class, but
BaseAdapter is not inherit from Activity.
I want to fire a dialog when I touch ImageView, so I wrote my code
(from API Demo - Efficient List) below..
I don't know how to fire a dialog...

......
private static class EfficientAdapter extends BaseAdapter {
....

     /**
                 * Make a view to hold each row.
                 *
                 * @see android.widget.ListAdapter#getView(int,
android.view.View,
                 *      android.view.ViewGroup)
                 */
                public View getView(int position, View convertView, ViewGroup
parent) {
                    // A ViewHolder keeps references to children views to
avoid unneccessary calls
                    // to findViewById() on each row.
                    ViewHolder holder;

                    // When convertView is not null, we can reuse it
directly, there is no need
                    // to reinflate it. We only inflate a new View when the
convertView supplied
                    // by ListView is null.
                    if (convertView == null) {
                        convertView =
mInflater.inflate(R.layout.list_item_icon_text, null);

                        // Creates a ViewHolder and store references to the
two children views
                        // we want to bind data to.
                        holder = new ViewHolder();
                        holder.textGoal = (TextView)
convertView.findViewById(R.id.textGoal);
                        holder.textPriority = (TextView)
convertView.findViewById(R.id.textPriority);
                        holder.icon = (ImageView)
convertView.findViewById(R.id.iconSetting);


                        holder.icon.setOnClickListener(new OnClickListener()
{
                            public void onClick(View v) {
                            }
                        });
                        convertView.setTag(holder);
                    } else {
                        // Get the ViewHolder back to get fast access to the
TextView
                        // and the ImageView.
                        holder = (ViewHolder) convertView.getTag();
                    }

                    // Bind the data efficiently with the holder.
                    holder.textGoal.setText(DATA[position]);
                    holder.icon.setImageBitmap(mIcon1);

                    return convertView;
                }

-- 

2. What happens to PendingIntents created for recieving Alarm Notifications when App is Force Killed?

I have an application that schedules Alarm notifications every x
minutes. The Alarm notification starts an IntentService which acquires
a WakeLock, launches another Service and releases the WakeLock. This
second service does some background processing and self stops.
The notifications and the services work well as designed.

When the application itself is force killed using Advanced Task
Killer, the Alarm notifications are never  received again. What
happens to the PendingIntent that causes the Alarm notifications if
the application that created the PendingIntent is force killed?

How do I recover from a situation where the application has been force
killed?

Best Wishes
Kishore

Moderators:
Not sure if this is a duplicate post, as I received an error message
when I tried to post this message a few seconds back. Please ignore
this if you already received the earlier post.

-- 

3. Sub-threads and widget-provider parameters

4. Video Issues in Android Emulator

5. USB Keyboard

6. How to detect if a soft keyboard is shown on the screen

7. how to count the number of sent/received sms/mms?