这可能看起来违反直觉,但有没有办法禁用或删除浮动标签提示TextInputLayout?我想要使用的原因TextInputLayout而不仅仅是EditText用于TextInputLayout提供的计数器.
这是我到目前为止:
<android.support.design.widget.TextInputLayout
android:id="@+id/textContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
app:counterEnabled="true"
app:counterMaxLength="100">
<EditText
android:id="@+id/myEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top|left"
android:inputType="textMultiLine|textCapSentences"
android:maxLength="100"
android:scrollbars="vertical"
android:hint="This is my cool hint"/>
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud) 根据Google提供给Android O的迁移指南,大多数隐式广播意图不应在Manifest中注册(减去此处的一些例外情况),但显式广播意图仍未触及.
我们希望将任何所需的广播从清单中移除.但是我们如何识别接收器是否隐含?有一般规则吗?
以下是我们在清单中注册的广播示例.我们应该只查看"action"标记,看看它是否被列入白名单以便将其保留在清单中?
<receiver
android:name=".receiver.ImageBroadcastReceiver"
android:enabled="true" >
<intent-filter>
<action android:name="android.hardware.action.NEW_PICTURE" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="image/*" />
</intent-filter>
</receiver>
<receiver
android:name=".receiver.InstallReferrerReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<receiver android:name=".receiver.JoinEventReceiver" >
<intent-filter>
<action android:name="JOIN_ACTION" />
<action android:name="CANCEL_ACTION" />
<action android:name="DECLINE_ACTION" />
</intent-filter>
</receiver>
Run Code Online (Sandbox Code Playgroud)
例如,"com.android.vending.INSTALL_REFERRER"意图未列入白名单.我们应该在活动中注册吗?如果是这样,它不会被解雇,因为当我们注册它时,应用程序已经安装?当我试图理解广播接收器是隐式的还是显式的时,这让我感到困惑,因为我认为我只需要检查"动作"标签.
android android-manifest android-intent android-broadcast android-8.0-oreo
有没有办法使用主题修改SwipeRefreshLayout中箭头的颜色?
我知道你可以使用这个代码编程
public void setColorSchemeResources (int... colorResIds)
Run Code Online (Sandbox Code Playgroud)
但我希望默认情况下将箭头设置为我的应用程序的主题,并且每次在某处使用SwipeRefrestLayout时都不必在代码中更改它.
在此处查看 Android Q中引入的存储访问更改后,默认情况下现在会删除位置信息。
Google要求我们以setRequireOriginal()媒体的uri作为参数调用“ MediaStore”对象。当您一张一张地获取媒体时,此方法有效,但是当我们查询整个画廊的ContentResolver时该怎么办?
请参阅此示例:
String[] projection = {
MediaStore.Files.FileColumns._ID,
MediaStore.Files.FileColumns.DATA,
MediaStore.Files.FileColumns.MEDIA_TYPE,
MediaStore.Images.Media.DATE_TAKEN,
MediaStore.Images.Media.WIDTH,
MediaStore.Images.Media.HEIGHT,
MediaStore.Images.Media.LATITUDE, // <----- THIS
MediaStore.Images.Media.LONGITUDE, // <----- THIS
MediaStore.Images.Media.MIME_TYPE,
};
String selection = MediaStore.Files.FileColumns.MEDIA_TYPE + "="
+ MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE;
Uri queryUri = MediaStore.Files.getContentUri("external");
Cursor cursor = null;
MediaStore a ;
try {
cursor = context.getContentResolver().query(queryUri, projection, selection,
null, MediaStore.Images.Media.DATE_TAKEN + " DESC");
}
catch (NullPointerException ex){
}
Run Code Online (Sandbox Code Playgroud)
从Q开始,纬度和经度始终设置为0。如果ACCESS_MEDIA_LOCATION在清单中添加了权限,是否可以获取一批媒体的位置数据?
我正在学习 android 滑动刷新布局。我在 swipeRefreshLayout“setRefreshing(true)”上发布 runabble,然后在 onRefresh 方法上我编写了 fetchMovie()。但 fetchMovie() 没有调用。如何修复它?
package com.example.zihadrizkyef.belajarswiperefresh;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.example.zihadrizkyef.belajarswiperefresh.app.MyApplication;
import com.example.zihadrizkyef.belajarswiperefresh.helper.Movie;
import com.example.zihadrizkyef.belajarswiperefresh.helper.SwipeListAdapter;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener {
private String TAG = MainActivity.class.getSimpleName();
private String URL_TOP_250 = "http://api.androidhive.info/json/imdb_top_250.php?offset=";
private SwipeRefreshLayout swipeRefreshLayout;
private ListView listView;
private SwipeListAdapter adapter;
private List<Movie> movieList;
private int …Run Code Online (Sandbox Code Playgroud)