小编Ant*_*ton的帖子

android 4.4中的字体问题

第一个屏幕 第二个屏幕

今天我已经将我的android sdk更新为19 api,在测试我的应用程序时,我遇到了19 api中的一些错误:在文本视图中删除一些字体,或者它的大小有问题.

第一个屏幕,一个视图的代码:

tvBalance = new TextView(getContext());
    rlParams = new LayoutParams(frame.width, (int) (frame.heigth * zoneExtetn));
    rlParams.setMargins(frame.left, (int) (frame.top - frame.heigth * (zoneUp-0.1f)), 0, 0);
    tvBalance.setLayoutParams(rlParams);
    tvBalance.setGravity(Gravity.CENTER);
    tvBalance.setPadding(0, 0, 0, 0);
    tvBalance.setTextColor(0xffffd008);
    tvBalance.setTextSize(PokerTextSize.scaleFont(getContext(), 28));
    tvBalance.setText("$ 0 000 000 000");
    tvBalance.setTypeface(TypefaceBase.getCalibri((Activity) getContext()));
    rlMoney.addView(tvBalance);
Run Code Online (Sandbox Code Playgroud)

和第二个屏幕代码:

TextView tvText = new TextView(llContent.getContext());
            llParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            llParams.setMargins(0, 0, 0, marg*2);
            tvText.setLayoutParams(llParams);
            tvText.setTextSize(fonts[0]);
            tvText.setTextColor(articleColor);
            tvText.setText(Html.fromHtml(articleItem.getString()));
            tvText.setTypeface(TypefaceBase.getCalibri((Activity) this.getContext()));

            llContent.addView(tvText);
Run Code Online (Sandbox Code Playgroud)

有人在android 4.4 kit-kat中有这些问题吗?

android android-4.4-kitkat

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

ActivityNotFoundException:快捷方式无法启动

我正在尝试对我的应用程序实施“应用程序快捷方式”,但无法使它们正常工作。我的shortcut.xml:

<Shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
    android:shortcutId="shortcut"
    android:enabled="true"
    android:icon="@drawable/ic_shortcut"
    android:shortcutShortLabel="@string/shortcut_label">
    <intent
        android:action="android.intent.action.VIEW"
        android:targetPackage="com.example"
        android:targetClass="com.example.package.Activity"/>
</shortcut>
Run Code Online (Sandbox Code Playgroud)

manifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example">

<application
    android:name=".Application"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:resizeableActivity="false"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <activity
        android:name=".package.Activity"
        android:label="@string/app_name"
        android:launchMode="singleTask"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>

        <meta-data
            android:name="android.app.searchable"
            android:resource="@xml/voice_search_params" />

        <meta-data android:name="android.app.shortcuts"
            android:resource="@xml/shortcuts" />
    </activity>
Run Code Online (Sandbox Code Playgroud)

所以,我做的快捷方式与Google示例相同。我可以看到并单击快捷方式,但没有任何反应。我尝试了不同的活动,更改了活动位置,活动动作,参数,例如“ exported = true”,但没有任何变化-在日志中,我只能看到

ActivityNotFoundException:快捷方式无法启动

我的快捷方式日志和Google相机快捷方式日志之间的唯一区别是活动路径:

I / ActivityManager:开始u0 {act = android.intent.action.VIEW flg = 0x1000c000 cmp = com.example / .package.Activity}

I / ActivityManager:START u0 {act = android.media.action.STILL_IMAGE_CAMERA flg …

android android-appshortcut

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