Error trying to change font android studio - java

I am trying to change the font of a TextView programatically in android studio, ive followed some tutorials closely but it keeps giving me errors and was just wondering if anyone has any ideas?
Examples of questions I followed:
Android develop LCD font
How to change the font on the TextView?
TextView:
TextView
android:id="#+id/settingsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Settings"
android:layout_marginLeft="60dp"/>
Code that changes font:
Typeface myTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/Stocky.ttf");
TextView settingsTitle = (TextView) findViewById(R.id.settingsTitle);
settingsTitle.setTypeface(myTypeface);
Error log:
Function: selinux_android_load_priority [0], There is no sepolicy file
Function: selinux_android_load_priority [1], There is no sepolicy version file
Function: selinux_android_load_priority , loading version is VE=SEPF_GT-I9507_4.3_0016
selinux_android_seapp_context_reload: seapp_contexts file is loaded from /seapp_contexts

It wasn't working because I was doing the code part in the onCreate, even though i was actually using fragments, so I just deleted the fragment and went back to using the normal activity and its working now.
thanks for the help.

Related

Error when click on edit text android

After actualization android studio to version 3.1 I have problem with my project.
When i click on edit text activity closing and throw exception.
I have no idea why is this happening, pls help.
E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!
E/AndroidRuntime: Error reporting crash
android.os.TransactionTooLargeException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:496)
at android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:4180)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:144)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
This is a bug in new android studio version(3.1), hope they fix it ASAP.
If you run same app without changing anything in previous version like 3.0 this app will work fine.
For now disabling it (Edit configuration settings -> Profiling -> Enable advanced profiling) prevents EditText from crashing

Read-only file system in android studio

i try to open the camera with th opencv library using android studio but it is not opened and the message appeared was " it seems that your device does not support camera( or it is locked) application will be closed" on the emulator screen
this is my logcat
09-09 19:39:17.436 11223-11223/? E/libprocessgroup: failed to make and chown /acct/uid_10058: Read-only file system
Unfortunately, if you are using emulator, it will not allow writing a file to its file system, unless you use API ver 21 or below. (That's what I tried once and it works probably.)
AVD does support camera, try edit AVD -> Advanced parameters.

Android Studio, unable to access data folder for database file on emulator

Ok, I have searched and searched without any success for someone with a similar question. I am developing an Android app using Android Studio and have started creating my SQLite database. In order to test my creation and upgrade functions I would like to extract my SQLite database and view it's contents.
Instructions online are fairly clear, open up Android Device Monitor, select the device, go to file explorer, and then browse a few levels deep in the data folder to find your .db file. Here is where the trouble starts. I am unable to expand the root level data folder at all. I have found numerous other questions regarding people having the same problem but they are all due to people trying to do it on un-rooted physical devices. I am simply trying to do it on an emulated device. I am certain it is a permissions problem but I'm not sure how to fix it.
Things I've tried:
Verified that my app is listed as a process on the device selected in the device monitor.
Restarted the AVD, Android Studio, and then my entire machine.
Uninstalled my app and reinstalled.
TLDR; can't access data folder in DDMS for emulated device in order to extract SQLite database file.
Same question to me.
When I want to access /data directory via Android Device Monitor, some error have occurred :
08-21 07:32:36.837: W/ls(3101): type=1400 audit(0.0:50): avc: denied { getattr } for path="/default.prop" dev="rootfs" ino=2941 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0
08-21 07:32:37.418: W/PlatformStatsUtil(2507): Could not retrieve Usage & Diagnostics setting. Giving up.
This information tells us we don't have permission to access the directory.
Here are what I have done and works for me.
My OS is Window10
Start your ADV & Open Android Device Monitor
cd to /the/path/to/Android/sdk/platform-tools
Open your cmd or openshell here (shift + right click you will see the option)
execute following commands
.
./adb.exe shell
su
chmod -R 777 /data/data/your/package
Now, enjoy your coding.
Run your app in an emulator with API 23 (or lower).
check detailed information in link below,
Android Device Monitor "data" folder is empty

Xml parsing images not showing in samsun galaxy 6 edge android 6.0.1

i don't know whats wrong with xml parsing, i am trying to code xml parsing with images and i have done the code but it is not showing the images in samsung galaxy 6 edge(android 6.0.1) and it is showing in my sony xperia x2 (android 5.1.1) please help, text is showing in samsung gamaly 6 edge but images are not showing please.
here is my logcat
java.io.FileNotFoundException: /storage/1B1A-321E/LazyLoaderExample/-1225947158: open failed: ENOENT (No such file or directory)

AdMob is throwing Fatal signal 11 (SIGSEGV) at 0x00000008 (code=1) on Phonegap 3

I am getting this error in logs and the app crashes:
15:53:22.518: A/libc(25934): Fatal signal 11 (SIGSEGV) at 0x00000008 (code=1), thread 25934 (s.testapp)
The error fired when:
I press/tap/slide over the admob banner.
Turn the mobile from landscape to portrait and viceversa.
Tap/press/slide fingers over the app (outside the banner).
I am using SDK GoogleAdMobAdsSdk-6.4.1 with Phonegap 3.0 on Android 4.1.2, I know is admob because when I disable it, the problem is gone.
Here is the code:
adView = new AdView(this, AdSize.BANNER, "xxxxxx");
LinearLayout layout = super.root;
layout.addView(adView);
layout.setHorizontalGravity(android.view.Gravity.CENTER_HORIZONTAL);
AdRequest request = new AdRequest();
//request.addTestDevice(AdRequest.TEST_EMULATOR);
adView.loadAd(request);
I have noticed that my app crashed too but only for animated ads.
Then, I turned the android:hardwareAccelerated to false in the manifest file in the application tag. My app is working fine now.

Categories