相关疑难解决方法(0)

通知文本太长,无法显示全文

我正在为android 2.3.3开发一个应用程序.我正在显示通知,但此通知的文字太长,并且没有显示全文及其被删除,因此如何在通知中显示我的全文?

这是代码:

String message = "Tonights Taraweeh consists of Alif Lam Mim and the first quarter of Sayaqul. The Surahs covered are Al-Fatiha(The Opening),and the first two-thirds of Al-Baqara(The Cow).";
Notification notification = new Notification();
notification.setLatestEventInfo(context, title, message, contentIntent);
Run Code Online (Sandbox Code Playgroud)

notifications android

9
推荐指数
2
解决办法
1万
查看次数

为什么我的TableLayout不允许膨胀?

对于小部件,我使用包含TableLayout的简单布局

<?xml version="1.0" encoding="utf-8"?>
<TableLayout  xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <TableRow >
         (...)
    </TableRow>
</TableLayout>
Run Code Online (Sandbox Code Playgroud)

但是,当我想通过创建一个更新其内容时 RemoteViews

RemoteViews eventElementLayout = new RemoteViews( this.getPackageName(), R.layout.widget_events_element );
Run Code Online (Sandbox Code Playgroud)

我有一个例外,告诉我TableLayout不允许膨胀.

12-04 01:36:12.548: WARN/AppWidgetHostView(195): updateAppWidget couldn't find any view, using error view
12-04 01:36:12.548: WARN/AppWidgetHostView(195): android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.TableLayout
12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)
12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
12-04 01:36:12.548: WARN/AppWidgetHostView(195):     at android.widget.RemoteViews.apply(RemoteViews.java:930) …
Run Code Online (Sandbox Code Playgroud)

layout android

6
推荐指数
1
解决办法
4381
查看次数

标签 统计

android ×2

layout ×1

notifications ×1