Muhammad Ammar Elahi

Greenhorn
+ Follow
since Apr 08, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Muhammad Ammar Elahi

Ok i will check it and let you know about that
9 years ago
Ok thanks for giving your time
9 years ago
9 years ago
I did but still getting same error
9 years ago
This issue i am facing what actually is


The below class is right?

**Notepad.java**

package com.example.activitylifecycle;

public class Notepad {
public class Notes {
public static final String COLUMN_NAME_NOTE = "note";
public static final String COLUMN_NAME_TITLE = "title";
}
}
9 years ago
Brother it is still showing me this error kindly check this i am follow this tutorial developer.android.com
9 years ago


Could you please tell me what is Notepad.Notes is it something class values.put(Notepad.Notes.COLUMN_NAME_TITLE, getCurrentNoteTitle()); ?


Logcats

12-25 19:20:57.230: E/AndroidRuntime(623): at java.lang.reflect.Method.invokeNative(Native Method)
12-25 19:20:57.230: E/AndroidRuntime(623): at java.lang.reflect.Method.invoke(Method.java:511)
12-25 19:20:57.230: E/AndroidRuntime(623): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-25 19:20:57.230: E/AndroidRuntime(623): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-25 19:20:57.230: E/AndroidRuntime(623): at dalvik.system.NativeStart.main(Native Method)
12-25 19:20:57.230: E/AndroidRuntime(623): Caused by: java.lang.NullPointerException
12-25 19:20:57.230: E/AndroidRuntime(623): at com.example.activitylifecycle.MainActivity.onCreate(MainActivity.java:25)
12-25 19:20:57.230: E/AndroidRuntime(623): at android.app.Activity.performCreate(Activity.java:5008)
12-25 19:20:57.230: E/AndroidRuntime(623): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-25 19:20:57.230: E/AndroidRuntime(623): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
9 years ago
I am learning ActivityLifeCycle from http://developer.android.com/training/basics/activity-lifecycle/stopping.html and getting message while running the code "Unfortunately ActiviyLifeCycle has stopped" and I want to know what is Notepad.Notes in values.put(Notepad.Notes.COLUMN_NAME_NOTE, getCurrentNoteText()); how to resolve this issue
Below is the code
**ActivityLifeCycle.java**

package com.example.activitylifecycle;

import android.content.ContentValues;
import android.location.LocationManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widget.TextView;
import android.content.Context;
import android.content.ClipData;



public class MainActivity extends ActionBarActivity {
TextView mTextView; //Member TextView
private Uri mUri;
private int mCurrentScore, mCurrentLevel;
static final String STATE_SCORE = "playerScore";
static final String STATE_LEVEL = "playerLevel";
/*private static final int COLUMN_NAME_NOTE=0;
private static final int COLUMN_NAME_TITLE=1;*/
@Override
protected void onCreate(Bundle savedInstanceState) {
// Save the user's current game state
savedInstanceState.putInt(STATE_SCORE, mCurrentScore);
savedInstanceState.putInt(STATE_LEVEL, mCurrentLevel);

// Always call the superclass so it can save the view hierarchy state
super.onSaveInstanceState(savedInstanceState);
super.onCreate(savedInstanceState);

// Check whether we're recreating a previously destroyed instance
if (savedInstanceState != null) {
// Restore value of members from saved state
mCurrentScore = savedInstanceState.getInt(STATE_SCORE);
mCurrentLevel = savedInstanceState.getInt(STATE_LEVEL);
} else {
// Probably initialize members with default values for a new instance
}
// Set the user interface layout for this Activity
// The layout file is defined in the project res/layout/main_activity.xml file
setContentView(R.layout.activity_main);

// Initialize member TextView so we can manipulate it later
mTextView = (TextView) findViewById(R.id.text_message);

// Make sure we're running on Honeycomb or higher to use ActionBar APIs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// For the main activity, make sure the icon in the action bar
// does not behave as a button
android.app.ActionBar actionBar = getActionBar();
actionBar.setHomeButtonEnabled(false);
}
}
public void OnRestoreInstanceState(Bundle savedInstanceState){
//Always call the superclass so it can restore the vie hierarchy
super.onRestoreInstanceState(savedInstanceState);

//Restore state members for state instance
mCurrentScore = savedInstanceState.getInt(STATE_SCORE);
mCurrentLevel = savedInstanceState.getInt(STATE_LEVEL);

}
@Override
public void onDestroy() {
super.onDestroy(); // Always call the superclass

// Stop method tracing that the activity started during onCreate()
android.os.Debug.stopMethodTracing();
}

@Override
protected void onStop(){
super.onStop(); //Always call superclass method 1st

//Save note current draft and we want to be sure current note's progress isn't lost
ContentValues values = new ContentValues();
values.put(Notepad.Notes.COLUMN_NAME_NOTE, getCurrentNoteText());
values.put(Notepad.Notes.COLUMN_NAME_TITLE, getCurrentNoteTitle());

getContentResolver().update(
mUri, // Uri for the Note to Update
values, // The map of column name and new values apply to them
null, // No select criteria are used
null // No where column are used
);
}

@Override
protected void onStart() {
super.onStart(); // Always call the superclass method first

// The activity is either being restarted or started for the first time
// so this is where we should make sure that GPS is enabled
LocationManager locationManager =
(LocationManager) getSystemService(Context.LOCATION_SERVICE);
boolean gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);

if (!gpsEnabled) {
// Create a dialog here that requests the user to enable GPS, and use an intent
// with the android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS action
// to take the user to the Settings screen to enable GPS when they click "OK"
}
}

@Override
protected void onRestart() {
super.onRestart(); // Always call the superclass method first

// Activity being restarted from stopped state
}
}

**Notepad.java**

package com.example.activitylifecycle;

public class Notepad {
public class Notes {
public static final String COLUMN_NAME_NOTE = "note";
public static final String COLUMN_NAME_TITLE = "title";
}
}
9 years ago
i mean that i wants to give a service in a website in which a functionality is present where anyone can put two images and compare where they are same of not even image are same but resolution are different message will be displayed images are same
9 years ago
I want to know that is it possible to match images in java and used in web? how is it possible?
9 years ago
Thanks Friend! Oracle didn't register online there must be in there office physically
I am from Pakistan this number is only valid for India
Hello Everyone
kindly guide me for Oracle Java exam registration. I first tried to register exam directly from Pearson Vue they said purchase voucher from oracle then i logged into oracle and start procedure i select i am an individual and they give me three options
1.Cheque
2.Purchase Order
3.Wired
i selected 2nd one then i move into next page and in Purchase Order field in write "123"
after ending i received a message we will email you in few days but i want to give exam in this friday, is this procedure is right? they didn't demand my Credit Card Number only email, name, address, will they get my credit card credentials after email?