I am trying to launch the mobile network settings screen in android 4.1 with a button click. On the button click I am getting “Could not find a method onOKclicked(View) in the activity class.” My code is below. Any help would be appreciated!
public void onOKclicked (Intent intent){
startActivityForResult(new Intent(android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS), 0);
startActivity(intent);
}
<activity android:name="android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS"></activity>
<Button
android:id="@+id/btnOK"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/OkButton"
android:onClick="onOKclicked" />
It is looking for a function named
onOKclickedwith aViewas parameter (the button)