02-23 18:15:06.222 8764-8764/com.itjungles.demo.demo E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.itjungles.demo.demo, PID: 8764 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.itjungles.demo.demo/com.itjungles.demo.test.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) 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:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference at com.itjungles.demo.test.MainActivity.onCreate(MainActivity.java:45) at android.app.Activity.performCreate(Activity.java:5933) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) 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:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

The reason you get the error is because your class declaration may be using ActionBarActivity instead of Activity. So what do you have to do to fix this. The simple solution is to use the method getSupportActionBar().

Graphic Resizer Tools

9Patch Resizer - this app automatically resize your original image to all the different size that can be use on your Android - Res - drawable folder. It can output for resolution of xxhdpi, xhdpi, hdpi, tvdpi, mdpi, ldpi. Once the folders has been created, you can simply copy all those folders and copy it to the res folder.

Set App Background Image

In LinearLayout tag, put in android:background="@drawable/background". Now make sure you put a background image with the name background in the res folder.

To access the layout in code and set the background or set the transparency use this code:

View layout = findViewById(R.id.layout);Drawable background = layout.getBackground();background.setAlpha(120); // This is to set the transparency. Value of 0 is full transparent and 255 is fully opaque. To use 9 patch drawable, put the .9 at the end of the background image. For example the background image must name as background.9.png

Set App Launcher Icons

Once you have generated the icons from the Simple Nine-patch Generator, download and copy the res folder to the project directory. Make sure the name of the icon is ic_launcher. If you have name it differently, then you would need to open up the manifest file and change the name in the <application android:icon="@drawable/ic_launcher" /> to a new name.

Different Activity Life Cycle

Created - onCreated()

Started - onStart()

Resumed - onResume()

Paused - onPause()

Stopped - onStop()

Destroyed - onDestroy()

onRestart()

onResume()

Open Web Browser With Set URL Web Address

In the manifest xml file, declare the event. For example, if a user click on the button to open up the browser and automatically open up the webpage www.itjungles.com. Then you would use this line:

Broadcaster and Receiver

There are many reason why you Windows 8 wouldn't boot, and you can try a number of different things to fix the boot issue.

When they computer start, try to boot into the recovery mode. Once in recovery mode open up command prompt.

Then try to put in these command:

Bootrec /fixmbrbootrec /fixbootbootrec /rebuildbcd

When running the command /rebuildbcd you may get a return result of 0. If this is is the case then you may have to run the command:

bcdedit and press return.

Depending on your situation, running that command may resulted in an error:

The boot configuration store could not be opened.

The requested system device cannot be found.

If you have got the above error, you could try to Refresh your PC option. However, you may still face a different error when trying to restore or refresh the pc.

You may see it say: The drive where Windows is installed is locked. This error is usally because you boot into recovery using the DVD repair disk or the USB repair disk.

You can also try:

bcdboot c:\windows

When trying that you may get the error:

Failure when attempting to copy boot files.

This is because the partition table may have been corrupted. You will need to assign a drive letter to the volume.

1. In command prompt type in DISKPART. Once in diskpart, type in list volume. This will shows all the disks available on your computer. Volume will start from 0, 1, 2 and so on. Depending on how may disk you have connected.

2. Then put in the command select volume n. Where n is the volume number.

3. Now put in assign letter=Y. Where Y is the drive letter you wish to use.

With hackers now a day using all sort of methods to acquire your password and get into your account, it is important that we setup a 2-step verification process. In this post I will show you how you can enable 2 step verification for Yahoo Mail.

1. First log into your Yahoo account.

2. Then click on your account name at the top left corner of the website. From the menu popup choose Account Info.

5. Now you will need to click on Use Current Phone or Add new phone. If you previously have added in the phone number then an option will be available for you to choose.

6. On the next screen you should see a successful message on the background, and a popup message ask if you want to create app passwords. This password can be used for mail app on iPhone, iPad or Android Phone.

7. Click on Generate password if you want to setup Yahoo mail on the smart phone.

8. On the next screen you can give your password a name label. This is to help you remember which password is for which app on which device. In this example I name it Android Gaglaxy S5.

9. Now click on Generate password button.

Finally a password is generated for you to use with your smart phone app.

At this point you can create as many password as you like, so that you could use one for Outlook, one for iPhone or one for the Android phone.

In this post I will show you a quick way to get the import statement of a class using the keyboard shortcut.

Let say in the code, you want to use a class Display, but in order to use it you have to import the package android.view or you have to import the reference class android.view.Display.

In the import declaration you could use the following two lines:

import android.view.Display; (or the next line)

import android.view.*; (this would import all the classes from the view package)

Sometimes you may remember the class name but not necessarily which package it belongs to. So using the keyboard shortcut it will automically create the statement for you. Here's how:

1. In your code, start typing in the class name. Android Studio should display the class name in red text indicating that it cannot reference a classname.

2. Place the curson after the class name and press CTRL + SPACE BAR key.

3. Now you should see a popup with a list of class you can choose. Choose the correct class from the suggested list to create an import statement.

Now go back to the top of the page and you should see that the import statement of the class automatically inserted for you. The un-identified class name in red text should change the font color from red to black signify that the error has gone away.