小编Pan*_*kaj的帖子

android可以像整数数组一样存储drawable id吗?

我想drawable,我可以像一个存储整数值的ID数组integer-arrayres/values/XXX.xml,通过使用integer-array标签.下面是声明的整数数组strings.xml

<integer-array name="icons">
     <item>1</item>
     <item>2</item>
     <item>3</item>
     <item>4</item>
</integer-array>
Run Code Online (Sandbox Code Playgroud)

但我想将可绘制的图像ID存储@drawable/someImage为xml中的整数数组.

或者是否有任何替代方法可以将可绘制的整数id存储为xml中的整数数组.

android android-resources android-drawable

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

以编程方式将文本颜色设置为辅助颜色

如何以编程方式将文本颜色设置为"textColorSecondary"?我已经尝试了下面的代码,但它不起作用.有谁知道代码有什么问题?

TextView tv1 = ((TextView)v.findViewById(R.id.hello_world));
tv1.setTextColor(Color.textColorSecondary);
Run Code Online (Sandbox Code Playgroud)

java android textview android-layout

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

尝试在空对象引用上调用虚拟方法'void com.google.android.gms.maps.GoogleMap.setOnMapLongClickListener'

当我长按地图时,应在该位置添加标记。但是它不起作用。我尝试运行此应用时,我的应用崩溃了。请帮帮我

这是我的代码

package inandroid.jeetna.memorableplaces;


import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.MenuItem;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

public class MapsActivity extends AppCompatActivity implements OnMapReadyCallback,GoogleMap.OnMapLongClickListener {

    private GoogleMap mMap;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_maps);
        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
        SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);

        mMap.setOnMapLongClickListener(this);

        android.support.v7.app.ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);


        Intent i = getIntent();
        Log.i("locationInfo", …
Run Code Online (Sandbox Code Playgroud)

android android-maps

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

谷歌地图 Android 的自定义信息窗口

我想要点击custom info window时出现marker

我希望它是这样的:

ImageView

TextView

TextView

TextView

Button  Button
Run Code Online (Sandbox Code Playgroud)

我看到了其他人对此的帖子问题,但仍然令人困惑。

android google-maps infowindow google-maps-markers android-button

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

How can I move button with keyboard when keyboard is opened

How can I move button like below image : 在此处输入图片说明tton when keyboard is show display.

android android-keypad

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