I want to share selected text in textview with the text selection toolbar.
This is my textview.xml
<TextView
android:id="#+id/txt_content"
fontPath="fonts/Roboto-Regular.ttf"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:text="#{data}"
android:bufferType="spannable"
android:textColor="#color/md_black_1000"
android:textIsSelectable="true"
android:textSize="22sp" />
The textview content is a spannable with html code
binding.setData(SearchTextHighlight.highlight(searchKeyWord, Html.fromHtml(articles.getContent())));
I get the following error when i select share. I Hope my question is clear.
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:740)
at android.app.ContextImpl.startActivity(ContextImpl.java:727)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:345)
at android.widget.TextView.shareSelectedText(TextView.java:11284)
at android.widget.TextView.onTextContextMenuItem(TextView.java:10833)
at android.widget.Editor$TextActionModeCallback.onActionItemClicked(Editor.java:3681)
at com.android.internal.policy.PhoneWindow$DecorView$ActionModeCallback2Wrapper.onActionItemClicked(PhoneWindow.java:4170)
at com.android.internal.view.FloatingActionMode$4.onMenuItemSelected(FloatingActionMode.java:108)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:801)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:155)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:954)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:944)
at com.android.internal.view.FloatingActionMode$5.onMenuItemClick(FloatingActionMode.java:136)
at com.android.internal.widget.FloatingToolbar$FloatingToolbarMainPanel$1.onClick(FloatingToolbar.java:1298)
at android.view.View.performClick(View.java:5698)
at android.widget.TextView.performClick(TextView.java:10888)
at android.view.View$PerformClick.run(View.java:22570)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7231)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
add this line , to the Intent you used to share
Intent i = new Intent(.........);
//add this line
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Related
I have a problem regarding android layout that I am not able to resolve. I have a fragment with a layout that contains lots of elements and in particular this CardView element
<androidx.cardview.widget.CardView
android:id="#+id/search_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
app:cardBackgroundColor="#color/chartMax"
app:cardCornerRadius="20dp"
app:cardElevation="2dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"
android:text="Cerca"
android:textAlignment="center"
android:textColor="#fff"
android:textSize="23sp" />
</androidx.cardview.widget.CardView>
I access this element in fragment
private lateinit var searchButton: CardView
searchButton = view.search_button
and everything works fine, I can use it normally.
The problems start when I add a normal SearchView to the fragment.
<androidx.appcompat.widget.SearchView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
When I run the application it crash on this instruction
searchButton = view.search_button
This is the stacktrace
E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.atoka.mobile, PID: 31291
java.lang.ClassCastException: androidx.appcompat.widget.AppCompatImageView cannot be cast to androidx.cardview.widget.CardView
at io.atoka.mobile.fragments.SearchFragment.getViewElements(SearchFragment.kt:57)
at io.atoka.mobile.fragments.SearchFragment.onCreateView(SearchFragment.kt:73)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2439)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:620)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
at android.app.Activity.performStart(Activity.java:7157)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2937)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
like if my CardView was an AppCompatImageView that is not. When I remove the SearchView the application works normally.
Anyone knows the solution? Is there any bug regarding this particular case?
Thank you
Your problem occurs because of the name you gave to your cardview
search_button is already define in default androidx.appcompat.widget.SearchView class as below:
final ImageView mSearchButton;
mSearchButton = findViewById(R.id.search_button);
so when you trying to get it from binding it's getting conflicted with the SearchView class search_button parameter
try to change the name of your cardview to something else then try,
I have a TextInputEditText inside a TextInputLayout in my xml code.
<android.support.design.widget.TextInputLayout
android:id="#+id/textfieldContainer2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:errorEnabled="true"
app:errorTextAppearance="#style/customErrorTextColor"
app:hintTextAppearance="#style/customHintTextAppearance"
app:layout_constraintTop_toBottomOf="#id/textfieldContainer">
<android.support.design.widget.TextInputEditText
android:id="#+id/bottomtextfield"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="add bottom text"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
</android.support.design.widget.TextInputLayout>
Problem
I am trying to get TextInputLayout via TextInputEditText as shown below
TextInputLayout parentInputLayout = (TextInputLayout) textfield.getParent();
but this line of code throws java.lang.IllegalStateException
Question
What am I doing wrong here and how can I get parent TextInputLayout of any TextInputEditText through TextInputEditText's reference.
Stacktrace
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.yousafkhan.memegeneratorapp, PID: 10425
java.lang.IllegalStateException: Could not execute method for android:onClick
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:390)
at android.view.View.performClick(View.java:6597)
at android.view.View.performClickInternal(View.java:6574)
at android.view.View.access$3100(View.java:778)
at android.view.View$PerformClick.run(View.java:25885)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385)
at android.view.View.performClick(View.java:6597)
at android.view.View.performClickInternal(View.java:6574)
at android.view.View.access$3100(View.java:778)
at android.view.View$PerformClick.run(View.java:25885)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to android.support.design.widget.TextInputLayout
at com.example.yousafkhan.memegeneratorapp.MainActivity.textFieldEmpty(MainActivity.java:64)
at com.example.yousafkhan.memegeneratorapp.MainActivity.createMeme(MainActivity.java:53)
Getting a reference to the TextInputLayout that contains the TextInputEditText can be done as the following:
TextInputEditText textfield = findViewById(R.id.bottomtextfield);
ViewGroup containingLayout = (ViewGroup) textfield.getParent();
TextInputLayout textInputLayout = (TextInputLayout) containingLayout.getParent();
This is because TextInputLayout has a FrameLayout on it that contains the TextInputEditText associated.
The view hierarchy in xml may not be same as the view herarchy returned by android. So getParent() may not return you the expected view.
Therefore you should prefer using :
TextInputLayout parentInputLayout = findViewById(R.id.textfieldContainer2);
I have the following TextView
<TextView
android:id="#+id/LoginlinkLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical center_horizontal"
android:autoSizeMaxTextSize="45sp"
android:autoSizeMinTextSize="15sp"
android:autoSizeStepGranularity="2sp"
android:text="#string/Loginlink"
android:textAlignment="center"
android:textSize="15sp"
android:onClick="loginlinkLabelonClick"
android:clickable="true"/>
And this function
fun loginlinkLabelonClick(context:Context)
{
val urlString="http://www.google.gr"
val intent = Intent(Intent.ACTION_VIEW,Uri.parse(urlString)) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.`package`="com.android.chrome"
try
{
context.startActivity(intent)
}
catch(ex:ActivityNotFoundException)
{
intent.`package`= null
context.startActivity(intent)
}
}
The error message:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.reviewer.reviewer, PID: 27809
java.lang.IllegalStateException: Could not find method loginlinkLabelonClick(View) in a parent or ancestor Context for
android:onClick attribute defined on view class
android.support.v7.widget.AppCompatTextView with id 'LoginlinkLabel'
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.resolveMethod(AppCompatViewInflater.java:423)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:380)
at android.view.View.performClick(View.java:6291)
at android.view.View$PerformClick.run(View.java:24931)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7425)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
But as soon as I tap the textview the application crashes and I can't seem to find what's wrong.
I'm new to Java, kotlin and Android studio.
I had a previous experience with visual studio and c# and Java / kotlin feels a bit strange
Now I'm really trying to figure out how to open urls, but I'm having trouble getting it to work
Usually when you have a click method in the xml, the argument for the method in kotlin is a view instance, see more here. So your method should look like this:
fun loginlinkLabelonClick(view:View)
{
}
i have made a recyclerview adapter where i am showing many things in recyclerview. and i am also showing some image in a view with viewpager. its working fine but when i am adding viewPagerArrowIndicator library for viewpager indicator its showing above error during i scroll back to up from bottom. i have tried solutions with stackoverflow but there are no similar error or solution
logcat:
Process: com.systechdigital.webadeal, PID: 30287
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:4659)
at android.view.ViewGroup.addView(ViewGroup.java:4495)
at android.view.ViewGroup.addView(ViewGroup.java:4436)
at android.view.ViewGroup.addView(ViewGroup.java:4409)
at com.sembozdemir.viewpagerarrowindicator.library.ViewPagerArrowIndicator.arrange(ViewPagerArrowIndicator.java:107)
at com.sembozdemir.viewpagerarrowindicator.library.ViewPagerArrowIndicator.bind(ViewPagerArrowIndicator.java:82)
at com.systechdigital.webadeal.NewsFeedAdapter.onBindViewHolder(NewsFeedAdapter.java:197)
at com.systechdigital.webadeal.NewsFeedAdapter.onBindViewHolder(NewsFeedAdapter.java:38)
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6310)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6343)
at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5289)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5552)
at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:270)
at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:324)
at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:337)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:344)
at android.support.v7.widget.GapWorker.run(GapWorker.java:370)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
my adapter code:
//image slider
if(newsFeedClassArrayList.get(position).getImageList()!=null){
holder.viewPager.setVisibility(View.VISIBLE);
viewPagerAdapter=new ViewPagerAdapter(context,newsFeedClassArrayList.get(position).getImageList());
holder.viewPager.setAdapter(viewPagerAdapter);
**//error showing below on line**
holder.viewPagerArrowIndicator.bind(holder.viewPager);
holder.viewPagerArrowIndicator.setArrowIndicatorRes(R.drawable.arrow_left_black_24dp,R.drawable.arrow_right_black_24dp);
viewPagerAdapter.notifyDataSetChanged();
}else {
holder.viewPager.setVisibility(View.GONE);
}
holder.timeStampTvId.setText(newsFeedClass.getTimeStamp());
xml code:
<com.sembozdemir.viewpagerarrowindicator.library.ViewPagerArrowIndicator
android:id="#+id/viewPagerArrowIndicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.v4.view.ViewPager
android:layout_width="wrap_content"
android:layout_height="180dp"
android:id="#+id/viewPagerId_imageView"
android:minHeight="0dp"
>
</android.support.v4.view.ViewPager>
</com.sembozdemir.viewpagerarrowindicator.library.ViewPagerArrowIndicator>
Try to use another library, even if you don't want to use that just use it for testing.
Maybe you can try this - https://github.com/ongakuer/CircleIndicator
I have an app that is about a year old, is on the Play store in beta, has gone through dozens of revisions. All of a sudden I'm getting an error:
Could not find a method onClick_Foo(View) in the activity class
android.view.ContextThemeWrapper for onClick handler on view class
android.widget.Button with id 'Foo_Button'
I'm getting this error on every one of the 7 buttons defined in my XML. Since yesterday I've updating appcompat-v7 from 21.0.3 to 22.0.0 but also upgraded my testing device from KitKat to Lollipop for the first time.
I've double-checked spellings, capitalizations, none of the usual suspects explains this. Here's a sample of the relevant code. Let me know if you feel more would be helpful. (The activity has 915 lines of code and the xml 186, so don't ask for the whole thing). Testing on a Verizon Note 4 running Lollipop 5.0.1
activity_pick.xml:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:theme="#style/AppTheme"
tools:context="com.myapp.Pick"
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
android:orientation="vertical">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/Ratings_Button"
android:textSize="16dp"
android:text="#string/Pick_Ratings_Button"
android:onClick="onClick_Ratings"
android:background="#android:drawable/btn_default"/>
</LinearLayout>
</ScrollView>
Pick.java:
public class Pick_Restaurant extends ActionBarActivity {
public void onClick_Ratings (View v) {
Intent intent = new Intent(mContext, Ratings.class);
startActivityForResult(intent,RATINGS);
}
}
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 59
versionName "0.6.4"
}
...
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.0.0'
compile files('libs/mobileservices-1.1.5.jar')
}
Full Error on Log:
04-08 17:06:40.578 3508-3508/com.myapp.debug E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.myapp.debug, PID: 3508
java.lang.IllegalStateException: Could not find a method onClick_Ratings(View) in the activity class android.view.ContextThemeWrapper for onClick handler on view class android.widget.Button with id 'Ratings_Button'
at android.view.View$1.onClick(View.java:4234)
at android.view.View.performClick(View.java:5191)
at android.view.View$PerformClick.run(View.java:20916)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5974)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Caused by: java.lang.NoSuchMethodException: onClick_Ratings [class android.view.View]
at java.lang.Class.getMethod(Class.java:665)
at android.view.View$1.onClick(View.java:4227)
at android.view.View.performClick(View.java:5191)
at android.view.View$PerformClick.run(View.java:20916)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5974)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
It looks like this is a new issue with Android 5.0.
From this anwer, removing the Theme from the layout xml fixed this issue for them.
So in your case, remove the theme from your layout:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!--android:theme="#style/AppTheme"--> <!-- Remove this -->
<!--................-->
</ScrollView>
And add the theme in the AndroidManifest.xml instead:
android:theme="#android:style/AppTheme"
I have just answered a similar question here
Basically, since Android 5.0 individual views can be themed.
To facilitate this, a ContextThemeWrapper is used to modify the underlying theme assigned to the Activity and assigned as the Context of the View. Since this Context is not your Activity anymore (the Activity has to be separate because it still has to return the original theme) the callbacks don't exist and you get the error you see.
If you don't really want to theme individual views the obvious solution is to not do so and theme the activity instead, as already suggested.
If you do indeed want to theme individual views, it appears that the android:onClick attribute cannot be used and you will have to fall back to manually assign an OnClickListener.
The question is, why did this work pre Lollipop? I can only speculate that because the functionality to theme individual views didn't exist, applying a theme attribute to a view would just change the default theme on the Activity as well.
Such things usually happens when you declare onClick in xml like you did:
android:onClick="onClick_Ratings"
Just make sure you are using this layout in that activity. Because the exception is clearly saying that your activity don't have the corresponding method which you did show you have:
public void onClick_Ratings (View v) {
Intent intent = new Intent(mContext, Ratings.class);
startActivityForResult(intent,RATINGS);
}
Also I guess you should declare the activity in your xml like:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".SendMessageActivity">
And actually log says:
Could not find a method onClick_Ratings(View) in the activity class
android.view.ContextThemeWrapper
there is something wrong since android.view.ContextThemeWrapper is not an Activity and not the activity from your xml com.myapp.Pick (I assume Pick is an activity and not the fragment). Maybe try to clean up the project, ivalidate caches and restart.
If nothing helps I suggest you to return back to previuos version of support lib you'd mentioned OR to set onClickListener in code instead of xml.
Removing android:theme works. But this is caused because using android:onclick in xml. If you use onClick in Java file, you can still use android:theme.
According to your code,
activity_pick.xml [Remove onclick here]
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/Ratings_Button"
android:textSize="16dp"
android:text="#string/Pick_Ratings_Button"
android:background="#android:drawable/btn_default" />
Go to your Java File, that is, pick.java in your case:
final Button button = (Button) findViewById(R.id.Ratings_Button);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent activityChangeIntent = new Intent(CurrentActivity.this, SecondActivity.class);
SplashScreen.this.startActivity(activityChangeIntent);
}
});
Experienced the same error, app has stopped working, when material button was clicked programmatically helped me. Check it out :)