Android : ScrollView on widget occurs error

on Wednesday, August 6, 2014


when i use scrollview for widget, it's not working.. it says like problem has occured on loading the widget.. can't i use the scrollview on widget or i did wrong for using the scroll view? here is my code..



<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="3dp" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="sjfdiosjdfiosjdfoijsdfjisdjfosjdfiosjdfiosdjf
sdjf
jsdjfosijdfo
sjdf
jsd
fs
dfjsdfdfsdfsdfsd
iofjsjofdsd" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="sjfdiosjdfiosjdfoijsdfjisdjfosjdfiosjdfiosdjf
sdjf
jsdjfosijdfo
sjdf
jsd
fs
dfjsdfdfsdfsdfsd
iofjsjofdsd" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="sjfdiosjdfiosjdfoijsdfjisdjfosjdfiosjdfiosdjf
sdjf
jsdjfosijdfo
sjdf
jsd
fs
dfjsdfdfsdfsdfsd
iofjsjofdsd" />

</LinearLayout>

</ScrollView>


@Override
public void onReceive(Context context, Intent intent)
{
super.onReceive(context, intent);

RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_layout_copy);
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
ComponentName cpName = new ComponentName(context, EmateWidget.class);
appWidgetManager.updateAppWidget(cpName, remoteViews);
}

0 comments:

Post a Comment