IJET's Profile User Rating: -----

Reputation: 93 Whiz
Active Posts:
122 (0.13 per day)
14-October 12
Profile Views:
Last Active:
User is offline Dec 18 2013 01:02 AM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Your Car:
Who Cares
Dream Kudos:

Latest Visitors

Icon   IJET has not set their status

Posts I've Made

  1. In Topic: Start Activity For Result ?

    Posted 15 Jun 2013

    Well, textV isn't a TextView, it's an EditText. You need to change that.

    I put the x.getText() value inside of the button that way it pulls the value once the button is clicked. If you set it on start up, it won't be equal to anything.

    Here is something that should work:

    package com.example.exampleapp;
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.view.View.onclickListener;
    import android.widget.Button;
    import android.widget.TextView;
    public class ActivityTwo extends Activity{
    	String password = "password";
            String x;
    	protected void onCreate(Bundle savedInstanceState) {
    		Button btn_2 = (Button)findViewById(R.id.button_2);
    			EditText textV = (EditText)findViewById(R.id.et_View);
    		btn_2.setonclickListener(new onclickListener(){
    			public void onclick(View view){
    				x = textV.getText().toString();
    				startActivity(new Intent(ActivityTwo.this, ActivityThree.class)); 
  2. In Topic: JavaScript File Not Working

    Posted 12 Jun 2013

    Well, you aren't referencing a JQuery library anywhere in your files from what I can see. You can download it and reference it locally or use Google as the host and include something like the following:

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
  3. In Topic: Accessing Layout Elements Outside Activity

    Posted 4 Jun 2013

    Well, as I cannot see your code, I am not able to understand exactly what your problem is. I will post a couple examples of how to change the text by calling a method from another class:

    Example 1:


    public void doSomething(TextView v){


    public class MainActivity extends Activity implements onclickListener {
    	Button button;
    	buttonclick bc;
    	TextView tv;
    	protected void onCreate(Bundle savedInstanceState) {
    		bc =  new buttonclick();
    		tv = (TextView)findViewById(R.id.textView1);
    		button = (Button)findViewById(R.id.button1);
    	public void onclick(View v) {
    		case R.id.button1:

    Example 2:


    public class buttonclick implements onclickListener {
    	TextView tv;
    	public buttonclick(TextView t){
    		tv = t;
    	public void onclick(View v) {


    public class MainActivity extends Activity {
    	Button button;
    	TextView tv;
    	protected void onCreate(Bundle savedInstanceState) {
    		tv = (TextView)findViewById(R.id.textView1);
    		button = (Button)findViewById(R.id.button1);
    		button.setonclickListener(new buttonclick(tv));

    The above examples are rather simple and showcase a few different ways to pull off changing the text. In the first, just passing a TextView reference "tv" that is tied to a TextView in the layout through the method doSomething in the buttonclick class. The second example is pretty self explanatory after seeing the first. Not all sure what else you're trying to change, just see you mentioned setting text values so this should push you in the right direction.
  4. In Topic: Accessing Layout Elements Outside Activity

    Posted 4 Jun 2013


    I'm doing my best to try and understand your code. It would seem you're just wanting to swap-in and out layouts, right?


    I'm writing an app right now, and the way I implement different "pages" or layouts in the app is by using different classes for each. I pass the main Activity into each class's constructor, and use that from there to use findViewById and in each class I set the onclickListeners for each button and I also set some the values of each view.

    You really need to be using fragments to do this. If you're unaware of how fragments work, here is a quick link to get you started(there's a lot of tutorials out there if need be). They will allow you to load in new layouts & functionality very easily and it's the correct way. They're the preferred method for doing what you're doing and it's common practice that one should always use them when designing UIs. For an example of their magic: a single activity will run that can host a fragment that inflates a layout. Great, after it's inflated now you want a new layout. The activity stays running, but you swap out the previous fragment for the new fragment. On large screens, you can run two fragments inside of one activity displaying two UIs at once. There's NO limit to how many fragments you can swap in and out.


    However, after testing my app, I realized that if I set the onclickListener from another class that is not the Main Activity, it just doesn't process. I'm not really sure why this would be,

    I guess this part is kind of confusing to me. The Main Activity will be looking within itself for functionality. I don't know that there is a way to do what you're doing as fragments are the correct way to handle these things.
  5. In Topic: Signature of the Month: June 2013

    Posted 1 Jun 2013

    Haven't been around for a bit and missed quite a few of these. Here's my submission for this month:

    Posted Image

My Information

Member Title:
D.I.C Head
Age Unknown
Birthday Unknown
Years Programming:
Programming Languages:
C++, C#, Java, HTML/CSS, JavaScript/Jquery, SQL

Contact Information



IJET hasn't added any friends yet.


IJET has no profile comments yet. Why not say hello?