It’s funny how we spent about an hour trying to figure out why the Intent extras that we’re setting are not being sent back to onActivityResult(). If we only knew that the solution was as simple as moving one line of code. The call to super.onBackPressed() should be placed after setting Intent extras and after […]
Technology
Android app dev: Missing import org.apache.commons.lang3.text.WordUtils;
I use a few instances of WordUtils.capitalizeFully() on an Android app that I’ve been working on. And there are times when the import org.apache.commons.lang3.text.WordUtils; breaks, sometimes after merging with some of my git branches. To fix this, what I do is open app/build.gradle and add the following line under dependencies:
1 |
compile 'org.apache.commons:commons-lang3:3.4' |
Hope this saves somebody […]
Something to avoid when using Android RecyclerView
When using Android’s RecyclerView, don’t use the same inflated XML layout file for items you intend to shuffle on the fly! Their contents will overlap. -CK
Android RecyclerView notifyItemChanged() IllegalStateException “Cannot call this method while RecyclerView is computing a layout or scrolling”
If your Android app is crashing with error IllegalStateException “Cannot call this method while RecyclerView is computing a layout or scrolling”, you may try placing your notifyitemchanged inside a Runnable. Assuming you have a call to notifyItemChanged() inside onBindViewHolder() that is making your app crash with IllegalStateException, you may try something like this:
1 2 3 4 5 6 7 8 9 |
myRecyclerView.post(new Runnable() { @Override public void run() { myArrayList.remove(position); myArrayList.add(something); recyclerViewMainScreenHeader.getAdapter().<code>notifyItemChanged</code>(); } }); |
Ubuntu: Show current Git branch on Terminal prompt
There are times when I keep running git status or git branch to check which branch I’m on and I just found that I could do something to show the name of my current Git branch on my Terminal prompt, thanks to a colleague. In the following screenshot I’m working in the directory “sample_app”, on […]
Setup/update Ruby on OS X El Capitan 10.11.5
I need to learn Ruby on Rails for my new job. I’m a little thrilled about this chance to learn a new language, and I’m trying to get started with it on my Macbook which runs OS X El Capitan 10.11.5. I already have Ruby here, I don’t remember if pre-installed though. It’s out of […]
Manila homemade cakes, cupcakes, cookies, brownies & more desserts at The Tiny Cakery
Update: We have rebranded into Catzie’s Cakery. When I’m not busy tapping codes on my keyboard, I either watch anime or bake. And there’s this “tiny” baking business in Manila I’m running, and really have a good time baking for people – friends, family, and even people I haven’t met prior to handing over their […]
Simple SMS Reader app in Android using BroadcastReceiver class
Before I began coding Android apps, I was amazed how verification processes go like this: The Android app tells you they’ll send you an SMS containing verification code, and that you need to enter such code into a text field on the Android app. But when you receive the SMS, the verification code appears on […]
Mac OS: How to batch edit file extension via Terminal
Today I had a directory of images whose file name extensions are .jpeg. I need them as .jpg but I didn’t want to rename them one by one. Here’s how we can change the file extensions in a directory by batch. And by the way, I am on Mac OS El Capitan version 10.11.5 with […]
Installing Laravel 5 on Apache in Mac OS X El Capitan
Last time, I wrote a guide on How to install Laravel 5 in Windows with XAMPP. I’ve been coding more often on Mac computers recently, and now I need to setup Laravel on a MacBook Pro, so I decided I’ll write a guide on how to install Laravel 5 on Mac OS X El Capitan […]