Disabling Android O auto-fill service for an application - android

Android O has the feature to support Auto-filling for fields. Is there any way I can disable it for a specific application. That is I want to force my application not to use the auto-fill service.
Is it possible ?
To block autofill for an entire activity, use this in onCreate() of the activity:
getWindow()
.getDecorView()
.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS);
Is there any better method than this ?

Currently there is no direct way to disable the autofill for an entire application, since the autofill feature is View specific.
You can still try this way and call BaseActivity everywhere.
public class BaseActivity extends AppCompatActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
disableAutofill();
}
#TargetApi(Build.VERSION_CODES.O)
private void disableAutofill() {
getWindow().getDecorView().setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS);
}
}
You can also force request autofill this way.
public void forceAutofill() {
AutofillManager afm = context.getSystemService(AutofillManager.class);
if (afm != null) {
afm.requestAutofill();
}
}
Note: At the moment autofill feature is only available in API 26 Android Oreo 8.0
Hope this helps!

I believe the accepted answer is incorrect:
So I have my own class which is extends the android.support.v7.widget.AppCompatEditText and all I did is overwrote the following method with the following value:
#Override
public int getAutofillType() {
return AUTOFILL_TYPE_NONE;
}
no other solutions worked, not even android:importantForAutofill="no".
getAutofillType() comes from the View class, so it should work for every other class such as TextInputEditText too!

I ran into this too. It turns out the issue was caused by setting the hint text on the EditText nested inside the TextInputLayout.
I did some digging and found this nugget in the 26.0.0 Beta 2 release notes.
Andorid Support Release Notes June 2017
TextInputLayout must set hints on onProvideAutofillStructure()
That led me to try setting the hint on the TextInputLayout instead of the nested EditText.
This resolved the crashing issue for me.
Example:
<android.support.design.widget.TextInputLayout
android:id="#+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Some Hint Text"
android.support.design:hintAnimationEnabled="true"
android.support.design:hintEnabled="true"
android.support.design:layout_marginTop="16dp">
<android.support.design.widget.TextInputEditText
android:id="#+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.TextInputLayout>

Seems to be a bug that needs to be fixed : https://issuetracker.google.com/issues/67675432
In the meanwhile a workaround for now is to disable the AutoFill feature for the whole project.
You can add in the values-v26/styles.xml file the following style or you can edit your BaseEditTextStyle if you are using a specific style for your EditText views.
<style name="App_EditTextStyle" parent="#android:style/Widget.EditText">
<item name="android:importantForAutofill">noExcludeDescendants</item>
</style>
and in the values-v26/themes.xml file you can simply add to the default theme that you are using in your app the items editTextStyle and android:editTextStyle like following :
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
<item name="android:editTextStyle">#style/App_EditTextStyle</item>
<item name="editTextStyle">#style/App_EditTextStyle</item>
</style>
this way you can apply this changes for all your EditTexts without needing to change your layout files or Activities (and later on you can easily remove it when the bug is fixed).

Is it possible ?
Not that I am aware of. Certainly, nothing is documented.
Is there any better method than this ?
Not that I am aware of.

In your EditText attributes add android:importantForAutofill="no"
This should be a temporary fix and will only apply to api 26+

Create custom EditText style and set android:importantForAutofill to no.
<style name="EditTextStyleWithoutAutoFill" parent="Widget.AppCompat.EditText">
<item name="android:importantForAutofill">no</item>
</style>
Then in your activity theme set this style for editTextStyle.
<item name="android:editTextStyle">#style/EditTextStyleWithoutAutoFill</item>

In my case, our app targets SDK version 21 but newer devices (26+) were still popping up the autocomplete. Pretty big problem if the app runs on devices that are shared between people. Using just android:importantForAutofill="no" did not work for me.
The only solution that I found to work in my case was:
<EditText
android:importantForAutofill="no"
tools:targetApi="o"
android:autofillHints="AUTOFILL_HINT_SMS_OTP" ...
The reason I added android:autofillHints="AUTOFILL_HINT_SMS_OTP" was because if you long-pressed on the EditText it would still bring up autofill. Basically, I told the field's autofill that it is waiting for a text message that will never be sent. Bit of a hack, I know...
Note: you may have to add xmlns:tools="http://schemas.android.com/tools" to your schemas' if it is not there already.

Had the same problem with API 28+ and disable Autofill. For me the only solution was to disable long click for my views.
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:longClickable="false"
android:text="#={model.emailAdress}"/>

With reference to Google issue tracker, it has been fixed.
This is fixed on Android 8.1
If any issue persists, please report at Google issue tracker they will re-open to examine.

Related

Error message text for TextInputLayout is cut off

Hey anyone know why this (see in the picture) happens?
It's happens for Xiaomi MiA1, while on Nokia 7.1 works fine.
My xml view layout
FrameLayout - root
ScrollView
RelativeLayout
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/til_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/profile.EMAIL"
android:theme="#style/TextInputLayoutTheme"
android:margin="16dp"
android:paddingBottom="8dp"
app:layout_constraintTop_toBottomOf="#+id/phone_wrapper"
>
<com.google.android.material.textfield.TextInputEditText
android:id="#+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:textSize="16sp"
android:textColor="#color/darkTextColor"
android:imeOptions="actionDone"
tools:text="Email"
/>
</com.google.android.material.textfield.TextInputLayout>
I think that putting TextInputLayoutTheme is not relevant here, since I only manipulate with view's colors
The error message text gets cut off if you are setting the error on a TextInputLayout more than once.
So every time you are setting TextInputLayout error message text, just set it to null first.
textInputLayout.setError(null);
textInputLayout.setErrorEnabled(false);
textInputLayout.setError("Error Message");
Layout Inspector shows that even if there is some space for the error it doesn't draw view in all of it. Everything there is in LinearLayouts (and one simple FrameLayout) so there is no way something would overlap it, paddings are set to 0, there is no code changing height or something suspicious in the implementation, so I don't know what might be a reason of such behaviour.
Although I've found some solution which works. You need to find in TextInputLayout a view holding error (with id textinput_error) and add some small padding to it. I've done it by extending TextInputLayout and adding such code into init.
val errorTV = findViewById<TextView>(R.id.textinput_error)
errorTV.updatePadding(top = 4)
There is already issue on issue tracker - https://issuetracker.google.com/issues/116747167 so lets hope Google will fix it some day.
I resolved issue by saving and restore LayoutParams:
final ViewGroup.LayoutParams params = textInputLayout.getLayoutParams();
textInputLayout.setError(errorMessage);
textInputLayout.setLayoutParams(params);
I resolved issue by increasing size of error font to 14sp (orginal is 12sp)
<com.google.android.material.textfield.TextInputLayout
[...]
app:errorTextAppearance="#style/MyProfile.Error">
<style name="MyProfile.Error" parent="TextAppearance.Design.Error">
<item name="android:textSize">14sp</item>
</style>
Although as Shabbir Dhangot said I may be that setting TIL.setErrorEnabled(true) may help for some else.
As some have already pointed out, this is a known bug. See https://issuetracker.google.com/issues/116747167
I solved this by doing something like this (note that below code is Kotlin, so != works on Strings):
if(myInputLayout.error != error){
myInputLayout.error = error
}
I know it is not the best solution, but you can add a \n to the beginning of your error message.
For example, if your error is Error, just change it to \nError.
If you want to change the size of the \n you can use:
String newLine = "\n";
String errorMessage = "Error";
SpannableString spannableErrorMessage = new SpannableString(newLine + errorMessage );
spannableName.setSpan(new TextAppearanceSpan(activity, R.style.my_style),0,a.length(), 0);
spannableName.setSpan(new RelativeSizeSpan(2.0f), a.length(), a.length() + 1, 0);
You can use this Kotlin extension:
/**
* Fix a bug with [TextInputLayout] that cut the error text when setting the same text twice.
*/
fun TextInputLayout.setFixedError(errorTxt: CharSequence?) {
if (error != errorTxt) {
error = errorTxt
}
}
Usage:
yourTextInput.setFixedError("Your error text")

Xamarin:Unable to convert instance of type Android.Widget.LinearLayout to type Android.Support.V7.Widget.Toolbar

The app is running on Android 6 or below. But when running on Android 7 (Nougat) it throws runtime exception.
System.InvalidCastException: Unable to convert instance of type 'Android.Widget.LinearLayout' to type 'Android.Support.V7.Widget.Toolbar'.
The error is thrown in Xamarin (Visual studio 2017) at below code:
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
ToolbarResource = Resource.Layout.toolbar;
TabLayoutResource = Resource.Layout.tabs;
base.OnCreate(bundle); //Runtime error here
.... Other code ...
}
}
I've taken latest updates for All Nuget packages but not able to identify the issue. For testing I'm using Moto G4+ (Android 7.0).
Can anybody help please?
Edit 1:
Layout of toolbar is as : (Under resources > layout > toolbar.axml). This was already there when App version with Android 6 released. But Now visited app back for Android 7 issues.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
I solved this by just cleaning the entire solution and closing the emulator. Then deploy again and it should work.
I tried SeƱor Hernandez's answer without much success, then realized I had accidentally deleted Resources/Resource.designer.cs from my Android project. I had meant to delete it from disk only, expecting it to get regenerated on rebuild. It did get regenerated, but that did not add it back to the project. Doing so (right-click, include in project) solved the issue on my part.
It got solved by downloading android_m2repository_r29.zip repository from https://developer.xamarin.com/guides/android/troubleshooting/resolving-library-installation-errors/ with instruction given in same.
I also tested the issue by creating a new fresh solution and got some style "Resource not found error". That was also fixed and then the original problem also got fixed.
You get this kind of error when trying to assign a control (a UI element in your xml) on a variable that is not of the same type. I get this error frequently when I make a mess and try to assign an EditText to a TextView variable or vice versa, i. e
EditText myText = FindViewById<TextView>(Resource.Id.myText);
or
TextView myText = FindViewById<EditText>(Resource.Id.myText);
I'm pretty sure that in your case you are trying to assign an Android.Widget.LinearLayout to a variable of type Android.Support.V7.Widget.Toolbar.
I think in your case one of this variables have been defined as LinearLayout in your xml:
Resource.Layout.toolbar
Resource.Layout.tabs
Meanwhile, one of this variables have beeen defined as Toolbar in your C# code, so te cast is not possible:
ToolbarResource
TabLayoutResource
If the problem persist, you can also try to check the type Android.Support.V7.Widget.Toolbar, instead it could be Android.Widget.Toolbar in your xml or code.

Span error when sending email from android device within the app [duplicate]

I have the following layout (virtually empty):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/set_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:contentDescription="content desc"
android:orientation="vertical" >
<TextView android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
</LinearLayout>
The Activity class contains the following:
public class TestActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
}
}
When I run this on my mobile device I get the following error:
SpannableStringBuilder
SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
I have tried this with and without the TextView and the error still remains, I must be doing something fundamentally wrong for such a basic layout to cause this.
Does anyone have any ideas on how I can get this to load without the error?
I have run into the same error entries in LogCat. In my case it's caused by the 3rd party keyboard I am using. When I change it back to Android keyboard, the error entry does not show up any more.
Because the error you're getting is not related to an EditText, then it's not related to your keyboard.
The errors you are getting are not a result of your code; you probably are testing on a Samsung device that has Samsung's TouchWiz.
I had the same errors, then I tested on a Nexus S (also by Samsung, but pure Android OS without TouchWiz) and I didn't get this error.
So, in your case, just ignore these errors while testing on a device! :)
Looking at your code, I'm not sure why you're getting that error, but I had this same error but with EditText fields.
Changing android:inputType="text" (or any of the other inputType text variations) to android:inputType="textNoSuggestions" (or android:inputType="textEmailAddress|textNoSuggestions", for example) fixed it for me.
You can also set this in Code with something like
mInputField.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
Looks like Android assumes by default that EditText fields will have suggestions. When they don't, it errors. Not 100% confident in that explanation, but the above mentioned changes fixed it for me.
http://developer.android.com/reference/android/text/Spanned.html#SPAN_EXCLUSIVE_EXCLUSIVE
Hope this helps!
On your android phone go to:
settings -> application manager -> all -> samsung keyboard and then click on "clear cache"
(delete all data collected by this application).
Try using the default Android keyboard it will disappear
Make clear you have pass a value in your MainAcitivity for the following methods onCreateOptionsMenu and onCreate
In some cases, the developer deletes the "return super.onCreateOptionsMenu(menu)" statement and changed to "return true".
This worked for me...on every device
<EditText
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="15sp"
android:layout_centerVertical="true"
android:textColor="#000"
android:id="#+id/input_search"
android:background="#null"
android:inputType="text"
android:hint="Enter Address, City or Zip Code"
android:imeOptions="actionSearch"
/>
In Java code:
mSearchText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
#Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
if(actionId == EditorInfo.IME_ACTION_SEARCH
|| actionId == EditorInfo.IME_ACTION_DONE
|| keyEvent.getAction() == KeyEvent.ACTION_DOWN
|| keyEvent.getAction() == KeyEvent.KEYCODE_ENTER){
//execute our method for searching
}
return false;
}
});
I had the same warning and found that removing an unused #id got rid of the warning. For me it was obvious as the #id was associated with a growing list of textViews linked to a database, so there was a warning for each entry.
Masood Moshref is right, this error occur because the option menu of Menu is not well prepared by lacking "return super.onCreateOptionsMenu(menu)" in onCreate() method.
To try to debug this error, first go to your android terminal / console and execute this command:
ps | grep THE_ERROR_PID_YOU_GET_(IT_IS_A_NUMBER)
then if the output comes out as your app... it is your app causing the error. Try to look for empty Strings that you pass into the layout.
I had this exact same problem and it was my fault as I was passing an empty String into my layout. After changing the "" to " " this error went away.
If you don't get your app from the console output, then it is something else causing it (probably, as others said, the android keyboard)
I have faced the same issue. I almost wasted almost couple of weeks to resolved this issue.
Finally I had on doubt on myself and tried to create another project by copy and paste some startup files like SplashScreen & LoginScreen.
But with the same code still i was getting SPAN_EXCLUSIVE_EXCLUSIVE.
Then i have removed the handler code from splash screen and tried again and Wow its working.
I am not getting SPAN_EXCLUSIVE_EXCLUSIVE issue in logcat.
I wondering, why it is? till the time did not get any other solution but by removing handler from splash screen it is working.
Try and update here if it is resolved or not.
Check if you have any element such as button or text view duplicated (copied twice) in the screen where this encounters. I did this unnoticed and had to face the same issue.
I ran into this problem too when I copied some text from the Internet. My solution is to trim the text/remove formatting before doing any further processing.
I had the same problem but with a listView.... i solved it because i was using a wrong R.id.listView that list View needed to have a value, in my case it was strings that i saved on listView2... so the right code was R.id.listView2
I had the same problem then i fixed it by following code!
text = (EditText)findViewById(R.id.TextVoiceeditText);
text.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
this error also occurs due to changed API URL. try hitting the URL you are using in postman and c if it's working properly.
rechecking the APIs solved my problem
try avoiding use of view in xml design.I too had the same probem but when I removed the view. its worked perfectly.
like example:
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:inputType="number"
android:textColor="#fff" />
<view
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#f9d7db" />
also check and try changing by trial and error android:inputType="number" to android:inputType="text" or better not using it if not required .Sometimes keyboard stuck and gets error in some of the devices.
In my case, the EditText fields with inputType as text / textCapCharacters were casing this error. I noticed this in my logcat whenever I used backspace to completely remove the text typed in any of these fields.
The solution which worked for me was to change the inputType of those fields to textNoSuggestions as this was the most suited type and didn't give me any unwanted errors anymore.
in my case i click on recent apps shortcut on my cell phone and close all apps. This solution always work for me, because this error not related to code.
**DONT PUT SET TEXT IN TEXT WATCHER**etSearch.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable) {
visibleResultList = false
if (s.toString().length != 0) {
getSearchSuggetion(no_of_rec, 0, s.toString())
} else {
// etSearch.setText("")
}
Log.e("text_change","============"+s.toString())
}
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
}
})
To solve this problem just add android:usesCleartextTraffic="true" in your AndroidManifest.xml file which is at ..\app\src\main\AndroidManifest.xml just like bellow...

PhoneNumberFormattingTextWatcher is not working

I am trying to use PhoneNumberFormattingTextWatcher but there is nothing happening as if the code is not there
here is the code
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
EditText PhoneEdit = (EditText) findViewById(R.id.editText1);
PhoneEdit.addTextChangedListener(new PhoneNumberFormattingTextWatcher());
}
when entering 002010555666 it still the same no - or + or (), just the same without any formatting
is there anything missing in the code
help
Have had the same issue, but after removing android:digits="1234567890+" it gone.
I added a comment to YTerle's answer, but I wanted to put the complete answer below:
<android.support.design.widget.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:hint="#string/phone_number"
android:layout_marginBottom="5dp"
android:ems="10"
android:maxLength="14"
android:id="#+id/phone" />
Then in the code put the following:
phoneView.addTextChangedListener(new PhoneNumberFormattingTextWatcher());
I was having issues even after adding android:inputType="phone" in the XML.
The solution was to set the Language in the phone:
Settings -> Search for Language -> pick English (United States)
The format (999) 999-9999 is mostly used in the US, therefore the phone language should be set to that only.
Final Solution: The issue is only associated with the android:inputType you selected in XML. It won't work with the "number". You need to choose "phone" or no inputType.
I have used this in an application and it worked just fine in the emulator (Android_4.2_Emulator_Smartphone_Nexus_S using Platform 4.4.2, API 19) but had no effect at all when run on my Samsung Tab 3 device running Platform 4.1.2, API 17. Maybe it's device dependent? The documentation indicates it was introduced in API 1 so I would think it should have all the kinks worked out by now but evidently not.

cannot combine custom titles with other title features

I am getting this error when calling the setContentView() after
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.maintitlebar);
The code is in the onCreate() for my class which extends ListActivity.
My manifest XML file shows the default AppTheme for the application:
android:theme="#style/AppTheme"
I have updated styles.xml to be:
<resources>
<style name="AppTheme" parent="android:Theme.Light" >
<item name="android:windowNoTitle">true</item>
</style>
</resources>
This seems to be in accordance with the main posts on this error message. I have also cleaned the build, yet I am still getting the above error message. Has anybody any idea what is causing the clash?
I had a similar problem that drove me insane: I have 2 versions of the same app using a shared library project as their common code (over 95% of each app is made of that shared library project): One runs fine, without any problem whatsoever. The other crashes upon start with the same error message & symptoms you describe:
You cannot combine custom titles with other title features
The layout XML files are common as well! So, I couldn't find any explanation for this weird problem.
After much brainstorming between me, myself and I, I discovered that the only difference between the two apps is that the one that runs fine has this in its AndroidManifest.xml:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7" />
And the one that crashes has this in its AndroidManifest.xml:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="13" />
So, you see, the Android UI is touted as being a 4th-generation UI framework, in which the UI is declarative and independently themed, but at the end of the day it's all the same st: Developing in C (for example) for Microsoft Windows is no more time consuming than developing in Java for the Android because the Android development framework is full of landmines like this in which the compiler won't tell you anything at compile time, and the thrown exception won't tell you either. Instead, you have to rely on **luck finding that little snippet of documentation (that may or may not exist), providing you with a hint as to where to look for the root cause of the problem.
I hope that this information will be helpful to many who experience the same problem.
You should use
<item name="android:windowNoTitle">false</item>
in your custom theme
I have the same problem and here is what it worked for me:
AndroidManifest.xml
< application
...
...
android:theme="#style/CustomTheme" >
Styles.xml
< style name="CustomTheme" parent="android:Theme">
< /style>
MainActivity.java
1) super.onCreate(savedInstanceState);
2) requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
3) setContentView(R.layout.activity_main);
4) getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title1);
The order of the codes is important as shown above.
If you have:
1) requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
2) setContentView(R.layout.activity_main);
3) super.onCreate(savedInstanceState);
4) getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title1);
You will get this exception:
android.view.InflateException: Binary XML file line #37: Error inflating class fragment
It matters which parent theme you are using:
If I use parent="android:Theme", then android:windowNoTitle="false" works (as per #Vladimir's answer).
However, if I use parent="android:Theme.Holo.Light", then I need to use android:windowActionBar="false" (as per #Jasper's comment). Here's my working xml using the Holo Light theme:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.ScheduleTimes" parent="android:Theme.Holo.Light">
<item name="android:windowActionBar">false</item>
</style>
</resources>
Maybe this question up to this time is already solved, but i post this answer for those who are having this error...i had a very similar problem, and changing the manifest file didn't work at all, but what it worked for me was go to the gradle Scripts and go to the build.gradle(Module:app) in this file, i changed the minSdkVersion and the targetSdkVersion with the same in both of them in this case for example 7, and the app runs correctly!
I had the same problem. I downloaded an app named BlueToothChat.
So, I add the following code to the string.mxl file within the value folder:
<resources>
<style name="CustomTheme" parent="#android:Theme">
<item name="android:windowNoTitle">false</item>
</style>
<string name="app_name">Bluetooth Chat</string>
...
and then add: {Theme = "#style/CustomTheme"} to the home page of the activity page (BluetoothChat.cs):
namespace BluetoothChat
{
/// <summary>
/// This is the main Activity that displays the current chat session.
/// </summary>
[Activity (Label = "#string/app_name", MainLauncher = true,
Theme = "#style/CustomTheme", ConfigurationChanges
Android.Content.PM.ConfigChanges.KeyboardHidden |
Android.Content.PM.ConfigChanges.Orientation)]
public class BluetoothChat : Activity
However, I did not test variations of this procedure or define any real CustomTheme attributes.

Categories

Resources