在我的项目中,我在一条logcat
消息中收到以下信息TextView
:
D/TextView: setTypeface with style : 0
Run Code Online (Sandbox Code Playgroud)
我用过的主题styles.xml
:
<style name="GreenTheme" parent="Base.Theme.AppCompat.Light">
<item name="colorPrimary">@color/primaryGreen</item>
<item name="colorPrimaryDark">@color/primaryDarkGreen</item>
<item name="colorAccent">@color/accentGreen</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我也用 buildToolsVersion "26.0.1"
我也尝试Theme.AppCompat.Light.NoActionBar
用作父主题.消息仍然会被记录.
更新1
经过一些测试,我发现这只发生在*.Theme.AppCompat.Light.*
主题上.
Theme.AppCompat.Light.NoActionBar
最经常使用,并在材料设计的每个教程中都有.
如何解决这个问题?
更新2
注意:使用模拟器时,不显示此消息.这很可能是一个设备问题.
我想知道两个音频文件是否相同或者一个包含另一个。
为此,我使用音乐指纹
byte[] firstAudio = readAudioFileData("first.mp3");
byte[] secondAudio = readAudioFileData("second.mp3");
FingerprintSimilarityComputer fingerprint =
new FingerprintSimilarityComputer(firstAudio, secondAudio);
FingerprintSimilarity fingerprintSimilarity = fingerprint.getFingerprintsSimilarity();
System.out.println("clip is found at " + fingerprintSimilarity.getScore());
Run Code Online (Sandbox Code Playgroud)
要将音频转换为字节数组,我使用声音 API
public static byte[] readAudioFileData(final String filePath) {
byte[] data = null;
try {
final ByteArrayOutputStream baout = new ByteArrayOutputStream();
final File file = new File(filePath);
final AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(file);
byte[] buffer = new byte[4096];
int c;
while ((c = audioInputStream.read(buffer, 0, buffer.length)) != -1) {
baout.write(buffer, 0, c);
} …
Run Code Online (Sandbox Code Playgroud) 我创建了一个齐发请求以接收HTTPS后端。
RequestQueue queue = Volley.newRequestQueue(uiCallback.getContext(),
new SSLVerification().getHurlStack(uiCallback.getContext()));
JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET,
requestUrl, null, new Response.Listener<JSONObject>() {
...
}
req.setRetryPolicy(new DefaultRetryPolicy(3_600_000, 0, 0));
queue.add(req);
Run Code Online (Sandbox Code Playgroud)
在清单中,我添加了Internet权限,如下所示:
<uses-permission android:name="android.permission.INTERNET" />
Run Code Online (Sandbox Code Playgroud)
只需很短时间的请求,一切都可以正常工作。
但是,如果在请求后3分钟内收到响应,则应用程序什么也不会收到。
在后端,我设置了一个断点。3分钟后,我让后端将响应发送给应用程序,但没有任何反应。没有成功,没有错误,仅此而已。
如果我发出不带的HTTP请求SSLVerification
,那么6分钟后我也会收到响应。相反,HTTPS请求超过3分钟只是不想工作。
进行更改RetryPolicy
以发出许多请求,这只是一种解决方法,不是一种选择。
我使用 SAP 标准库:Inbox。
\n在图书馆课程中S3.controller
,点击附件图标是onTabSelect
来执行事件,女巫使
this.fnDelegateAttachmentsCreation();\nthis.fnFetchDataOnTabSelect("Attachments");\nthis.fnHandleAttachmentsCountText("Attachments");\nthis.fnHandleNoTextCreation("Attachments");\nbreak;\n
Run Code Online (Sandbox Code Playgroud)\nfnFetchDataOnTabSelect
进行异步调用。在这次通话期间是fnHandleAttachmentsCountText
已经执行,因此附件计数的更新发生在附件请求准备好之前。就附件请求而言,尚未执行任何标题更新。
屏幕截图上是 AttachmentCountText \xe2\x80\x9eAttachnents (1/1)\xe2\x80\x9c,它来自先前选择的项目。\n它应该是 \xe2\x80\x9eAttachnents (2/2)"。
\n\n此外,如果响应来得太快,则在收到请求的答案后,视图会更改为加载视图。\n如果附件列表是通过请求回调更新的,则不应第二次更新。
\n看起来,有一些东西正在加载,但请求已经完成。
\n\n如何扩展收件箱,以便在请求准备好后更新附件标题和内容?
\n使用 SAPUI5-版本:1.71.4
\n在一个Fragment
,Kotlins合成导入提供的布局Anko
是行不通的.我试图设置视图的可见性,但它说视图为空.我有以下代码.
class HistoryFragment : Fragment(), HistoryContract.view, LoaderManager.LoaderCallbacks<List<SongEntity>>{
private lateinit var mPresenter : HistoryContract.Presenter
private lateinit var adapter: HistoryAdapte
private val loaderId : Int = 101
override fun onLoadFinished(loader: Loader<List<SongEntity>>?, data: List<SongEntity>?) {
hideLoadingIndicator()
if (data == null) {
showErrorView()
} else {
//update the adapter
adapter.updateDataset(data)
}
}
override fun onLoaderReset(loader: Loader<List<SongEntity>>?) {
}
override fun onCreateLoader(id: Int, args: Bundle?): Loader<List<SongEntity>> {
showLoadingIndicator()
return object : AsyncTaskLoader<List<SongEntity>>(activity!!.baseContext){
override fun loadInBackground(): List<SongEntity>? {
return mPresenter.fetchSongs()
}
} …
Run Code Online (Sandbox Code Playgroud)