From the course: Android App Development: Working with Widgets

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Work with provider functions

Work with provider functions - Android Tutorial

From the course: Android App Development: Working with Widgets

Start my 1-month free trial

Work with provider functions

- [Instructor] Now that you understand what most elements of the AppWidgetProvider are for, let's go ahead and update the provider functions that we'll use to update our text when we tap on the button. So the first thing we're going to do is open the Test.Java file. So if you don't have tthat one open, click on the Java folder and then the com.example.helloworld and then click on the Test file. Once you have that open, we're going to add a few things to the import so click on the plus sign here and then let's go ahead and add some imports. So the first one we're going to add is android.content.Intent. Then we're also going to add import android.app, and let me just fix the import syntax, .PendingIntent. And then we'll also need to use a Java utility, so java.util.Random. Okay, so now that we have all of our imports, you can minimize that if you want, and then the first thing I'm going to do is completely copy all that text here from line 21 to 25, copy it, and then paste it inside the…

Contents