<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged java</title>
<link>https://www.question2answer.org/qa/tag/java</link>
<description>Powered by Question2Answer</description>
<item>
<title>Custom HTML - Unable to add java script</title>
<link>https://www.question2answer.org/qa/63598/custom-html-unable-to-add-java-script</link>
<description>

&lt;h1&gt;Forbidden&lt;/h1&gt;

&lt;p&gt;You don't have permission to access /Digital+Marketing+FAQ/index.php on this server.&lt;/p&gt;

&lt;p&gt;Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Getting this error on my site , when I try to add a javascript code (Contact form code) on the add html section.&lt;/p&gt;

&lt;p&gt;I checked the permisison of index.php file and changed it to 777. But still error coming.
&lt;br&gt;All folders have permission 755 and cache folder have permission 777&lt;/p&gt;

&lt;p&gt;Please help&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/63598/custom-html-unable-to-add-java-script</guid>
<pubDate>Fri, 20 Apr 2018 00:58:01 +0000</pubDate>
</item>
<item>
<title>Shared Preferences crashes program</title>
<link>https://www.question2answer.org/qa/26220/shared-preferences-crashes-program</link>
<description>

&lt;p&gt;
	Im trying to make this thing that generates worlds in my application for android but the ListActivity never opens because of the shared preferences. It says there is a storage null pointer exception, but I can't find a way to fix that. Any ideas? (It worked perfectly fine without the shared preferences.)&lt;/p&gt;


&lt;p&gt;
	Code:&lt;/p&gt;


&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;


&lt;ol&gt;
	

&lt;li&gt;
		

&lt;div&gt;
			//List Activity&lt;/div&gt;
		

&lt;div&gt;
			import android.app.ListActivity;&lt;/div&gt;
		

&lt;div&gt;
			import android.content.Intent;&lt;/div&gt;
		

&lt;div&gt;
			import android.content.SharedPreferences;&lt;/div&gt;
		

&lt;div&gt;
			import android.content.SharedPreferences.Editor;&lt;/div&gt;
		

&lt;div&gt;
			import android.os.Bundle;&lt;/div&gt;
		

&lt;div&gt;
			import android.view.View;&lt;/div&gt;
		

&lt;div&gt;
			import android.widget.ArrayAdapter;&lt;/div&gt;
		

&lt;div&gt;
			import android.widget.ListView;&lt;/div&gt;
		

&lt;div&gt;
			&amp;nbsp;&lt;/div&gt;
		

&lt;div&gt;
			public class WorldMenu extends ListActivity{&lt;/div&gt;
		

&lt;div&gt;
			String worldString2;&lt;/div&gt;
		

&lt;div&gt;
			String worldString;&lt;/div&gt;
		

&lt;div&gt;
			static String worldString3;&lt;/div&gt;
		

&lt;div&gt;
			String[] worldMenu;&lt;/div&gt;
		

&lt;div&gt;
			&amp;nbsp; &amp;nbsp; SharedPreferences worldList;&lt;/div&gt;
		

&lt;div&gt;
			@Override&lt;/div&gt;
		

&lt;div&gt;
			protected void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
		

&lt;div&gt;
			// TODO Auto-generated method stub&lt;/div&gt;
		

&lt;div&gt;
			super.onCreate(savedInstanceState);&lt;/div&gt;
		

&lt;div&gt;
			setListAdapter(new ArrayAdapter&amp;lt;String&amp;gt;(WorldMenu.this, android.R.layout.simple_list_item_1, worldMenu));&lt;/div&gt;
		

&lt;div&gt;
			worldMenu = worldString3.split(&quot;,&quot;);&lt;/div&gt;
		

&lt;div&gt;
			worldMenu[worldMenu.length] = &quot;Create World&quot;;&lt;/div&gt;
		

&lt;div&gt;
			worldString = &quot;Create World,&quot;;&lt;/div&gt;
		

&lt;div&gt;
			worldList = getSharedPreferences(&quot;worldString&quot;,0);&lt;/div&gt;
		

&lt;div&gt;
			worldString3 = worldList.getString(&quot;worldString&quot;, &quot;Worlds not found.&quot;);&lt;/div&gt;
		

&lt;div&gt;
			}&lt;/div&gt;
		

&lt;div&gt;
			&amp;nbsp;&lt;/div&gt;
		

&lt;div&gt;
			@Override&lt;/div&gt;
		

&lt;div&gt;
			protected void onPause() {&lt;/div&gt;
		

&lt;div&gt;
			// TODO Auto-generated method stub&lt;/div&gt;
		

&lt;div&gt;
			super.onPause();&lt;/div&gt;
		

&lt;div&gt;
			worldString2 = worldString3;&lt;/div&gt;
		

&lt;div&gt;
			Editor editor = worldList.edit();&lt;/div&gt;
		

&lt;div&gt;
			editor.putString(&quot;worldStuff&quot;,worldString2);&lt;/div&gt;
		

&lt;div&gt;
			editor.commit();&lt;/div&gt;
		

&lt;div&gt;
			}&lt;/div&gt;
		

&lt;div&gt;
			&amp;nbsp;&lt;/div&gt;
		

&lt;div&gt;
			@Override&lt;/div&gt;
		

&lt;div&gt;
			protected void onListItemClick(ListView l, View v, int position, long id) {&lt;/div&gt;
		

&lt;div&gt;
			// TODO Auto-generated method stub&lt;/div&gt;
		

&lt;div&gt;
			super.onListItemClick(l, v, position, id);&lt;/div&gt;
		

&lt;div&gt;
			&amp;nbsp;&lt;/div&gt;
		

&lt;div&gt;
			if(position == 0){&lt;/div&gt;
		

&lt;div&gt;
			Intent openGenerator = new Intent(&quot;blablabla.WORLDNAME&quot;);&lt;/div&gt;
		

&lt;div&gt;
			startActivity(openGenerator);&lt;/div&gt;
		

&lt;div&gt;
			}&lt;/div&gt;
		

&lt;div&gt;
			}&lt;/div&gt;
		

&lt;div&gt;
			&amp;nbsp;&lt;/div&gt;
		

&lt;div&gt;
			&amp;nbsp;&lt;/div&gt;
		

&lt;div&gt;
			}&lt;/div&gt;
	&lt;/li&gt;
	

&lt;li&gt;
		

&lt;div&gt;
			

&lt;div&gt;
				

&lt;div&gt;
					package x.x.x;&lt;/div&gt;
				

&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				

&lt;div&gt;
					//Naming Activity&lt;/div&gt;
				

&lt;div&gt;
					import android.app.Activity;&lt;/div&gt;
				

&lt;div&gt;
					import android.content.Intent;&lt;/div&gt;
				

&lt;div&gt;
					import android.content.SharedPreferences;&lt;/div&gt;
				

&lt;div&gt;
					import android.content.SharedPreferences.Editor;&lt;/div&gt;
				

&lt;div&gt;
					import android.os.Bundle;&lt;/div&gt;
				

&lt;div&gt;
					import android.view.View;&lt;/div&gt;
				

&lt;div&gt;
					import android.widget.Button;&lt;/div&gt;
				

&lt;div&gt;
					import android.widget.EditText;&lt;/div&gt;
				

&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				

&lt;div&gt;
					public class worldName extends Activity{&lt;/div&gt;
				

&lt;div&gt;
					EditText worldType;&lt;/div&gt;
				

&lt;div&gt;
					String worldName;&amp;nbsp;&lt;/div&gt;
				

&lt;div&gt;
					Button save;&lt;/div&gt;
				

&lt;div&gt;
					SharedPreferences wname;&lt;/div&gt;
				

&lt;div&gt;
					String nameworld = &quot;worldName&quot;;&lt;/div&gt;
				

&lt;div&gt;
					@Override&lt;/div&gt;
				

&lt;div&gt;
					protected void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
				

&lt;div&gt;
					// TODO Auto-generated method stub&lt;/div&gt;
				

&lt;div&gt;
					super.onCreate(savedInstanceState);&lt;/div&gt;
				

&lt;div&gt;
					setContentView(R.layout.activity_worldname);&lt;/div&gt;
				

&lt;div&gt;
					wname = getSharedPreferences(&quot;worldName&quot;,0);&lt;/div&gt;
				

&lt;div&gt;
					worldType = (EditText) findViewById(R.id.editText1);&lt;/div&gt;
				

&lt;div&gt;
					save = (Button) findViewById(R.id.button1);&lt;/div&gt;
				

&lt;div&gt;
					save.setOnClickListener(new View.OnClickListener() {&lt;/div&gt;
				

&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				

&lt;div&gt;
					@Override&lt;/div&gt;
				

&lt;div&gt;
					public void onClick(View v) {&lt;/div&gt;
				

&lt;div&gt;
					// TODO Auto-generated method stub&lt;/div&gt;
				

&lt;div&gt;
					worldName = worldType.getText().toString();&lt;/div&gt;
				

&lt;div&gt;
					WorldMenu.worldString3 += worldName+&quot;,&quot;;&lt;/div&gt;
				

&lt;div&gt;
					Intent intent = new Intent(&quot;com.mtprogramming.blockfight.WORLDGENERATOR&quot;);&lt;/div&gt;
				

&lt;div&gt;
					startActivity(intent);&lt;/div&gt;
				

&lt;div&gt;
					}&lt;/div&gt;
				

&lt;div&gt;
					});&lt;/div&gt;
				

&lt;div&gt;
					}&lt;/div&gt;
				

&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				

&lt;div&gt;
					}&lt;/div&gt;
				

&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/26220/shared-preferences-crashes-program</guid>
<pubDate>Tue, 30 Jul 2013 02:30:23 +0000</pubDate>
</item>
<item>
<title>How to: Turn off Ajax / java script for mobiles ?</title>
<link>https://www.question2answer.org/qa/11380/how-to-turn-off-ajax-java-script-for-mobiles</link>
<description>I am playing around with a mobile theme. It works great only the ajax forms on Blackberry show behind the text. Is there a way to turn off Ajax /Java for mobiles and show the normal answer and comment form through pagerefresh ?</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/11380/how-to-turn-off-ajax-java-script-for-mobiles</guid>
<pubDate>Fri, 23 Dec 2011 01:16:27 +0000</pubDate>
</item>
<item>
<title>How to add javascript to all pages at once</title>
<link>https://www.question2answer.org/qa/5079/how-to-add-javascript-to-all-pages-at-once</link>
<description>i &amp;nbsp;want to install google analystics in my web site.......in order to do that i should add a java script to all pages.....how to do that.......</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/5079/how-to-add-javascript-to-all-pages-at-once</guid>
<pubDate>Fri, 11 Mar 2011 11:54:47 +0000</pubDate>
</item>
</channel>
</rss>