小编Rah*_*tte的帖子

如何删除Google map v2中的标记?

我使用以下方法在地图上添加了标记,并保留了标记记录

public static void  showallLocations() 
    {
        ArrayList<LinkedHashMap<String, String>> listshow=latLngStoragepreference.getLatlng();
        markerlist=new ArrayList<Marker>();// to keep the marker record so that later we can delete
        if(listshow.size()>0)
        {
        for(int i=0;i<listshow.size();i++)
        {
        LinkedHashMap<String, String> Linkedhashmap=listshow.get(i);

        Set mapSet = (Set) Linkedhashmap.entrySet();
        //Create iterator on Set 
        Iterator mapIterator = mapSet.iterator();

        Map.Entry mapEntry = (Map.Entry) mapIterator.next();
        // getKey Method of HashMap access a key of map
        String keyValue = (String) mapEntry.getKey();
        //getValue method returns corresponding key's value
        String value = (String) mapEntry.getValue();
        String[] parts=value.split("#");
        String Latitude=parts[0];
        String Longitude=parts[1]; …
Run Code Online (Sandbox Code Playgroud)

android google-maps

2
推荐指数
1
解决办法
1万
查看次数

调用两次dispatchKeyEvent()

我调试了以下代码片段,发现该方法dispatchKeyEvent()被调用了两次。请提出解决方案

    @Override
public boolean dispatchKeyEvent(KeyEvent event) {
if(event.getKeyCode()== KeyEvent.KEYCODE_DPAD_CENTER)
    {
        if(cDetail.getVisibility()==View.VISIBLE  )
        {

            cDetail.setVisibility(View.INVISIBLE);
            cList.setVisibility(View.INVISIBLE);
        }

        else
        {

            cDetail.setVisibility(View.VISIBLE);
            cList.setVisibility(View.VISIBLE);

        }   


    }

    return super.dispatchKeyEvent(event);
}
Run Code Online (Sandbox Code Playgroud)

java android

2
推荐指数
1
解决办法
2608
查看次数

Kotlin是否提供任何额外的安全性?

当我们用Java开发Android应用程序时,我们可以选择对代码进行模糊处理并构建APK.

Kotlin有什么先进的功能吗?

security obfuscation bytecode proguard kotlin

0
推荐指数
1
解决办法
904
查看次数

如何获取ImageView的高度和宽度?

我正在尝试获取 ImageView bot 的高度和宽度,它返回 0

public class FullScreenImage extends FragmentActivity {
    ImageView full_view;
    int width;
    int height;
    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);

        setContentView(R.layout.full_screen);

        full_view   = (ImageView)findViewById(R.id.full_view);

        Bundle bundle=getIntent().getExtras();
        byte[] image=   bundle.getByteArray("image");

        width       =     full_view.getWidth();
        height      =     full_view.getHeight();

        Bitmap theImage = BitmapFactory.decodeByteArray(image, 0, image.length);
        Bitmap resized = Bitmap.createScaledBitmap(theImage,width , height, true);

        full_view.setImageBitmap(resized);
    }


}
Run Code Online (Sandbox Code Playgroud)

请帮助我,如何从 ImageView 中找到它?

android android-imageview

-1
推荐指数
1
解决办法
1468
查看次数