小编Vam*_*eni的帖子

在Android中使用Place picker google API选择匿名位置的位置时禁用选择按钮

我想用位置字段保存用户表单信息.对于位置我想在用户点击地图上的位置和填写后的位置到表单时,在某个按钮点击和位置上打开谷歌地图.

我找到了地方选择器作为相关的解决方案,所以我使用了Place Picker Google API,我可以打开谷歌地图,当我将箭头移到首选位置并点击选择此位置(显示黑色,现在坐标显示在该位置下).

确认框打开,有2个选项:

1.)更改位置
2.)选择(禁用模式)

我想选择匿名位置并返回主要活动.

以下是我的代码:

private TextView get_place;
int PLACE_PICKER_REQUEST    =   1;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    get_place   =   (TextView)findViewById(R.id.textView1);
    get_place.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            PlacePicker.IntentBuilder builder   =   new PlacePicker.IntentBuilder();
            Intent intent;
            try {
                intent  =   builder.build(getApplicationContext());
                startActivityForResult(intent,PLACE_PICKER_REQUEST );
            } catch (GooglePlayServicesRepairableException e) {
                e.printStackTrace();
            } catch (GooglePlayServicesNotAvailableException e) {
                e.printStackTrace();
            }
        }
    });
}

protected void onActivityResult( int requestCode , int resultCode , Intent …
Run Code Online (Sandbox Code Playgroud)

android google-maps google-places-api

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

Android中没有静态方法setOnApplyWindowInsetsListener异常

我昨天下载了Android Studio 2.1.3(在我使用1.5之前),现在我有这个例外:

java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompatLollipop; or its super classes (declaration of 'android.support.v4.view.ViewCompatLollipop'
Run Code Online (Sandbox Code Playgroud)

这会在MainActivity中的setContentView上停止我的应用程序.我怎么解决这个问题?

android exception android-support-library android-studio

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

在android XML上组合多个背景?

我可以将我自己的 android drawable 和 ?android:selectableItemBackground... 结合起来吗?我搜索了很多,但找不到正确的答案......例如,假设我有一个简单的按钮,我想要这个:

<Button
    android:id="@+id/bTest"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="?android:selectableItemBackground" | @drawable/myDrawable/>
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

xml android drawable

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

来自Kotlin类的调用方法

我有一个util Kotlin类,我在其中设置工具栏标题,隐藏或显示工具栏取决于片段:

class MyToolbarUtils() {

    fun hideToolbar(activity: Activity) {
        (activity as MainActivity).supportActionBar!!.hide()
    }

    fun showToolbar(activity: Activity, tag: String) {
        setToolbarTitle(tag, activity)
        (activity as MainActivity).supportActionBar!!.show()
    }

    fun setToolbarTitle(tag: String, activity: Activity) {
        var title = ""
        when (tag) {
            "Main_fragment" -> title = activity.resources.getString(R.string.Main_screen)
            "Add_note" -> title = activity.resources.getString(R.string.Add_note)
        }
        activity.title = title
    }
}
Run Code Online (Sandbox Code Playgroud)

如何从Fragment调用showToolbar(...)?我只是尝试过,MyToolbarUtils.showToolbar(..)但这是不可能的

我发现的唯一方法是:

val setToolbarTitle = MyToolbarUtils()
setToolbarTitle.showToolbar(activity, tag)
Run Code Online (Sandbox Code Playgroud)

但必须有更好的方法来做到这一点..

android toolbar fragment kotlin

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

在magento中重定向

我正在研究自定义模块.我尝试将我的模块重定向到magento目录类别页面.该页面的链接是

HTTP://localhost/project/index.php/admin/catalog_category/index/key/cc65595b0383ca64fb245cb7de2359d8/

我试过以下方法但没有成功.

$this->_redirect($this->getUrl("admin/catalog_category/")); $this->_redirect("admin/catalog_category/");

Magento正在从网址中删除管理员?最后的网址看起来像那样

HTTP://localhost/project/index.php//catalog_category/index/key/cc65595b0383ca64fb245cb7de2359d8/

我没弄明白为什么管理员会从我的网址中跳过?有人可以帮忙吗?

magento magento-1.7

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

magento注册用户详细信息存储在哪里

我正在运行 Magento 1.7.2。我想知道 magento 注册用户详细信息存储在哪里。实际上我需要,如果我们在注册表中添加一个新字段,其中字段的值存储在数据库表中。

mysql registration magento magento-1.7

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

通过订单ID获取订单详情

我需要通过 Magento 检索订单id
如何加载特定订单id

search magento magento-1.9

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