English 中文(简体)
地图上的塔似乎正在累积
原标题:Taps on a map appear to be accumulating
  • 时间:2011-11-23 13:19:24
  •  标签:
  • android

我写了一封信,显示在都柏林市存在一套交通照相机。 我在地图上显示这些标志。 当用户使用标识时,他们被带入新的活动,显示有关照相机的最新照片。 这似乎是为第一大公司工作。 图像显示和击退使你再次进入照相地点地图。 然而,再一次(同级标志或不同的标志)把你带上形象,然后点击显示你的形象。 《图像评论》的事例似乎与每一条连续主线相加。

相关的法典(我认为)是:

    @Override
    public boolean onTap(int index) {
        Log.d(TAG, "Tap done on" + index);
        Intent i = new Intent(TrafficViewActivity.this, CameraViewer.class);
        i.putExtra("imageSrc", getItem(index).getImageSrc());
        startActivity(i);
        return super.onTap(index);
    }

(没有习俗):

    @Override
    public boolean onTap(GeoPoint p, MapView mapView) {
        // mController.animateTo(p);
        Log.d(TAG, "onTap geopoint:");

        return super.onTap(p, mapView);
    }

The above 2 methods are both found in a class I have created with this signature:

class HelloItemizedOverlay extends ItemizedOverlay<MyOverlayItem>

目标活动刚刚恢复,情况如下:

@Override
protected void onResume() {
    super.onResume();
    Intent i = getIntent();
    Bundle ex = i.getExtras();
    if (ex != null) {
        String imageSrc = (String) ex.get("imageSrc");

        Log.d(TAG, "imageSrc: " + imageSrc);
        Util u = new Util();

        u.downloadFile(mImage, imageSrc);
    }
}

当我看我的记录时,确实看上去的是,主人被称作多次,但我不理解为什么如此。 任何帮助都是巨大的。

最佳回答

如果不深入研究这个问题,就可想到两点:

(1) 您的标记可能重叠,在这种情况下可以替换

return super.onTap(index);

iii

return true;

改变现状

2) 也许你会开始新的第二次活动,而不是在背景中重新利用。

不妨增加:

i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);

a. 在您启动之前(i);

我认为,其中一项或两项将有所助益,它们将严重影响发生的事情,从而试图消除。

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签