Android_K.Doe

Android

Don't say hi. Don't ask questions. Don't have fun. Don't do an...
Mar 1, 2019 04:44
guys what is the best way to add click listener to card view? When you add it normally, it doesnt work on child click
Mar 1, 2019 00:29
fragmentB.setArguments(bundle);
Feb 28, 2019 08:59
I notice from last time, about 2 days not opening my app, the next time i open it images doesnt load. Which makes me conclude Glide cache is being cleared. I tried disabling reading from cache and that confirmed that the path doesnt work with an error

    Permission Denial: opening provider com.android.providers.media.MediaDocumentsProviderith
Feb 28, 2019 08:50
I notice that Glide reads from cache, but after quite some time i guess the cache is cleared by the phone itself, which causes the Glide to reuse the path and search for origin, but since permission is not persistent even after using ACTION_OPEN_DOCUMENT, it always fails to load the image
Feb 28, 2019 08:43
According to documentation, `Intent.ACTION_OPEN_DOCUMENT` gives persistable permission to an image. But Glide seems to be unable to read path.

What would be the best approach in saving the uri image/path in local database?
Feb 28, 2019 08:35
oh its not a code block
Feb 28, 2019 08:35
I actually decided to join because i encountered a problem that i couldn't resolve regarding

Intent.ACTION_OPEN_DOCUMENT
Feb 28, 2019 08:33
i mean for example a code line
Feb 28, 2019 08:32
how does text highlights work here? just the same?
Feb 28, 2019 08:28
Thank you for the approval
Feb 28, 2019 08:19
I have read and understood the rules
 
May 7, 2018 08:02
Check the function i made before.. Understand it.. Then here's a snippet to get lines in a textfile before and after a specific line. I wont be giving the full code because this is so easy

boolean isAfter = false;

while ((line = file.readLine()) != null) {

if(line.contains("My Word")) isAfter = true;
else{
if(isAfter){
afterBuffer.append(line);
afterBuffer.append('\n');
}else{
beforeBuffer.append(line);
beforeBuffer.append('\n');
}
}
}
May 7, 2018 07:53
this is so easy i shoudnt be spoon feeding this
May 7, 2018 07:52
To get all lines before and after

boolean isAfter = false;

while ((line = file.readLine()) != null) {

if(line.contains("My Word")) isAfter = true;
else{
if(isAfter){
afterBuffer.append(line);
afterBuffer.append('\n');
}else{
beforeBuffer.append(line);
beforeBuffer.append('\n');
}
}
}
May 7, 2018 06:37
null.toString() error
May 7, 2018 06:37
naturally it would.. check your logic, currentLine = null in the end..
May 7, 2018 05:57
before it appends
May 7, 2018 05:57
above inputBuffer
May 7, 2018 05:55
put the IF above so it wont include the line with the word
May 7, 2018 05:53
break; mean to stop there.. the loop would stop
May 7, 2018 05:52
this is so easy come on.. For example

while ((line = file.readLine()) != null) {
inputBuffer.append(line);
inputBuffer.append('\n');

if(line.contains("My Word")) break;
}

String inputStr = inputBuffer.toString();

now print inputStr you will see all lines from above the line you specified
May 7, 2018 05:39
This is very simple. Try modifying this to satisfy your need. Clue, line is a string

while ((line = file.readLine()) != null) {
inputBuffer.append(line);
inputBuffer.append('\n');
}
May 7, 2018 02:57
inputStr = inputStr.split("Hello")[1]; i think this will work
May 7, 2018 02:32
just follow the function i made before.. then instead of replace do the split
May 7, 2018 02:31
array[1] from split = all text after the split word
May 7, 2018 02:30
exactly just what i said
May 7, 2018 02:28
you will get array[0] = hi array[1] = here
May 7, 2018 02:28
when you split that to hello
May 7, 2018 02:28
"hi hello here"
May 7, 2018 02:27
sample
May 7, 2018 02:27
yeah when you split to hello you will get the two
May 7, 2018 02:06
use array[1]
May 7, 2018 02:06
you will get 2 size array by that
May 7, 2018 02:05
do something like my function then split it to "Hello"
May 7, 2018 01:59
Yes?
May 4, 2018 05:04
you got it?
May 4, 2018 03:45
gonna go lunch. laters
May 4, 2018 03:41
yeah but sleep for about half a second
May 4, 2018 03:39
to stop execution
May 4, 2018 03:39
thread.sleep
May 4, 2018 03:39
make it a function and just call it if necessary
May 4, 2018 03:39
what do you mean?
May 4, 2018 03:29
Well sharedPref would work too i guess.. Then just update it in onDestroy()
May 4, 2018 03:20
I guess you just have to use Sqlite for that then just clear the table on the onDestroy()
May 4, 2018 03:18
Hmmm
May 4, 2018 03:18
fkin brownout haha
May 4, 2018 02:01
Whats up @KelvinJigSawing
May 4, 2018 02:00
Yo
May 3, 2018 08:23
Sure.. Just dont make me play a game of death my lord hahaha
May 3, 2018 08:19
@KelvinJigSawing