我想用位置字段保存用户表单信息.对于位置我想在用户点击地图上的位置和填写后的位置到表单时,在某个按钮点击和位置上打开谷歌地图.
我找到了地方选择器作为相关的解决方案,所以我使用了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 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 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)
有任何想法吗?
我有一个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)
但必须有更好的方法来做到这一点..
我正在研究自定义模块.我尝试将我的模块重定向到magento目录类别页面.该页面的链接是
我试过以下方法但没有成功.
$this->_redirect($this->getUrl("admin/catalog_category/"));
$this->_redirect("admin/catalog_category/");
Magento正在从网址中删除管理员?最后的网址看起来像那样
HTTP://localhost/project/index.php//catalog_category/index/key/cc65595b0383ca64fb245cb7de2359d8/
我没弄明白为什么管理员会从我的网址中跳过?有人可以帮忙吗?
我正在运行 Magento 1.7.2。我想知道 magento 注册用户详细信息存储在哪里。实际上我需要,如果我们在注册表中添加一个新字段,其中字段的值存储在数据库表中。
android ×4
magento ×3
magento-1.7 ×2
drawable ×1
exception ×1
fragment ×1
google-maps ×1
kotlin ×1
magento-1.9 ×1
mysql ×1
registration ×1
search ×1
toolbar ×1
xml ×1