在本文中,我们将详细介绍更改android字体不起作用的各个方面,并为您提供关于android改变字体的相关解答,同时,我们也将为您带来关于AndroidGPS清单不起作用、AndroidPOST请求
在本文中,我们将详细介绍更改android字体不起作用的各个方面,并为您提供关于android改变字体的相关解答,同时,我们也将为您带来关于Android GPS清单不起作用、Android POST请求不起作用、Android TV(Leanback Launcher) – Android开发人员的软键盘不起作用、android – Chrome自定义标签更改默认关闭按钮不起作用的有用知识。
本文目录一览:- 更改android字体不起作用(android改变字体)
- Android GPS清单不起作用
- Android POST请求不起作用
- Android TV(Leanback Launcher) – Android开发人员的软键盘不起作用
- android – Chrome自定义标签更改默认关闭按钮不起作用
更改android字体不起作用(android改变字体)
Typeface font = Typeface.createFromAsset(this.getAssets(),"fonts/Abumohammed.ttf"); textView.setTypeface(font);
我相信Abumohammed.ttf在资产/字体文件夹中..但字体不会改变,对textview没有任何影响!
解决方法
我会找到一些绝对有效的字体,such as this one,并尝试确保其余的代码都正常.如果确实你确定字体文件不起作用,AFAIK你别无选择,只能找到其他字体.
Android GPS清单不起作用
我使用了调试模式,在ActivityThread Perform Source下找不到.
我还添加了FINE LOCATION UNDER ..
<android.permission.ACCESS_COARSE_LOCATION" />
<android.permission.ACCESS_FINE_LOCATION" />
<android:name="android.permission.INTERNET" />
如何添加..到位置,如..
<android:name="android.permission.ACCESS_COARSE_LOCATION" />
<android:name="android.permission.ACCESS_FINE_LOCATION" />
<permission android:name="android.permission.INTERNET" />
<library android:name="com.google.android.maps" />
应该在哪里添加?
这是GPS的活动
<activity android:name="com.easyTravel.tool_gpsMap.tool_gpsMap"></activity>
解决方法:
应在应用程序标记之外添加这些权限,但用户库将位于应用程序标记内.
请参阅以下结构:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.live"
android:versionCode="2"
android:versionName="1.1">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".FirstAcivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- other activities here -->
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
希望这会帮助你.
Android POST请求不起作用
我正在这样做:
@Override
protected Void doInBackground(String... strings) {
try {
String query = "username=" + strings[0] + "&duration=" + strings[1] + "&distance=" + strings[2];
URL url = new URL(scoresActivity.URL);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
Writer writer = new OutputStreamWriter(conn.getoutputStream());
writer.write(query);
writer.flush();
writer.close();
/*conn.addRequestProperty("username", strings[0]);
conn.addRequestProperty("duration", strings[1]);
conn.addRequestProperty("distance", strings[2]);*/
Log.v(TAG, strings[0] + " - " + strings[1] + " - " + strings[2]);
//conn.connect();
} catch(Exception e) {
Log.e(TAG, "exception", e);
}
return null;
}
但该请求仅在服务器上不起作用…在服务器上,我应该看到发送的数据,但看不到它们
我也试过这个:
curl -XPOST --data "username=duri&duration=600&distance=555" http://someurl.com/
而且有效…可能是什么问题?
解决方法:
嘿,尝试使用这种语法.
@Override
protected String doInBackground(String... params) {
String urlString = params[0];
String userName = params[1];
String password = params[2];
URL url = null;
InputStream stream = null;
HttpURLConnection urlConnection = null;
try {
url = new URL(urlString);
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("POST");
urlConnection.setDoOutput(true);
String data = URLEncoder.encode("userName", "UTF-8")
+ "=" + URLEncoder.encode(userName, "UTF-8");
data += "&" + URLEncoder.encode("password", "UTF-8") + "="
+ URLEncoder.encode(password, "UTF-8");
urlConnection.connect();
OutputStreamWriter wr = new OutputStreamWriter(urlConnection.getoutputStream());
wr.write(data);
wr.flush();
stream = urlConnection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"), 8);
String result = reader.readLine();
return result;
} catch (IOException e) {
e.printstacktrace();
} finally {
if (urlConnection != null) {
urlConnection.disconnect();
}
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printstacktrace();
Log.i("Result", "SLEEP ERROR");
}
return null;
}
希望这可以帮助.
Android TV(Leanback Launcher) – Android开发人员的软键盘不起作用
关键是SoftKeyboard是可触摸的并且可以在移动设备上工作,所以在我的情况下,在Android TV上,键盘必须使用像Android的leanback键盘这样的遥控器.
有没有办法解释为Android TV创建InputMethodService?
Android TV的任何想法或具体文档?
仅供参考,我尝试使用Leanback Launcher和Nexus Player安装Android 5.0.2.
在此先感谢您的帮助
解决方法
https://developer.android.com/training/tv/start/index.html
在开发任何电视应用程序之前,请先检查此CheckList.
有没有办法解释为Android TV创建InputMethodService?
点击这里:http://developer.android.com/training/game-controllers/controller-input.html#dpad
希望它会有所帮助.!!
android – Chrome自定义标签更改默认关闭按钮不起作用
Android Studio 2.3
我正在尝试更改自定义chrome选项卡的操作栏上的默认关闭按钮.我试图设置使用setCloseButtonIcon()但是,默认关闭按钮仍然显示.我想改变靠近一个箭头.
我的代码如下:
public void openHomePage() { final CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); builder.setToolbarColor(ContextCompat.getColor(getActivity(),R.color.primary)); final Bitmap backButton = BitmapFactory.decodeResource(getResources(),R.drawable.ic_arrow_back_black_48dp); builder.setCloseButtonIcon(backButton); builder.setShowTitle(true); final CustomTabsIntent customTabsIntent = builder.build(); customTabsIntent.launchUrl(getActivity(),Uri.parse(mTvHomepage.getText().toString())); }
提前谢谢了,
解决方法
我使用here.的返回箭头图标检查了您的代码
当我使用“ic_arrow_back_black_48dp”时,它没有将默认关闭按钮更改为箭头(请参阅左图).
final Bitmap backButton = BitmapFactory.decodeResource(getResources(),R.drawable.ic_arrow_back_black_48dp);
但是当我使用“ic_arrow_back_black_24dp”时,它将默认的关闭按钮完美地更改为一个箭头(见右图).
final Bitmap backButton = BitmapFactory.decodeResource(getResources(),R.drawable.ic_arrow_back_black_24dp);
因为它对我来说完美,您还应该尝试使用“24dp”尺寸的箭头图标从here而不是“48dp”大小的返回箭头图标.
截图:[Device:ASUS_Z00UD;操作系统:6.0.1]
今天的关于更改android字体不起作用和android改变字体的分享已经结束,谢谢您的关注,如果想了解更多关于Android GPS清单不起作用、Android POST请求不起作用、Android TV(Leanback Launcher) – Android开发人员的软键盘不起作用、android – Chrome自定义标签更改默认关闭按钮不起作用的相关知识,请在本站进行查询。
本文标签: