Translate java widget to kotlin : <p>Can anybody help me with translating from java to kotlin?
I'm trying to make android widget that basically updates itself when the button is pushed.</p>

<pre><code>public class NewAppWidget extends AppWidgetProvider {

    @Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {

        for (int appWidgetId : appWidgetIds) {

            Intent intent1 = new Intent(context, NewAppWidget.class);
            intent1.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
            intent1.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
            PendingIntent pendingIntent1 = PendingIntent.getBroadcast(context,0, intent1, 0);

            RemoteViews remoteViews = new RemoteViews(context.getPackageName(),R.layout.new_app_widget);
            remoteViews.setOnClickPendingIntent(R.id.buttonId, pendingIntent1);

            //there will come my action

            appWidgetManager.updateAppWidget(appWidgetId, remoteViews);
        }
    }

}
</code></pre>

<p>Can anybody translate this for me?</p>
