I have two activities:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void click(View view) {
Intent intent= new Intent(this, TranslucentActivity.class);
startActivity(intent);
}
}
public class TranslucentActivity extends Activity
In my application i have 1 activity class,for that activity class i have set the layout ,which is another class file not "Xml File".
I'm trying to pass something from one class to my MainActivity, but it doesn't seem to work, I don't understand why.
I have my GPS Tracker on another class (not the MainActivity) in order to reuse it.
When the location changes, I want my other class to call a method from within the MainActivity to update my UI.
I summarized my code like that :
My MAIN ACTIVITY :
public class MainActivity exten
Hi im very very new to android, so this would be my first app.
Im taking a java class and trying to make an app similar to a lab
we did in class.
I have the following code where MyClass basically extends View. I was wondering if I need to use both setContentView(R.layout.activity_mainlcass_app) and setContentView(myDrawing) to show the 2D graphics that I draw in MyClass.
I have seen many examples with
startActivityForResult(Intent, int)
and then using
onActivityResult(int, int, Intent)
but for me I dont need to pass anything, I simply want to startActivity(intent), and when intent activity returns, a method get called in main activity..
Any tutorial on doing this?
EDIT:
Here a sample code:
public void onCreate(Bundle savedInstanceState) {
super.onCrea
Here is my WallePapeAuto.java code:
package com.demo.wallpaper;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
public class WallePapeAuto extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent(WalleP
I am trying to build a simple application with a button "Play" for Android.In the MainActivty.java file,I get errors with the following code,so what do I need to rectify here?
package com.example.simplemusicplayer;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
pub
I am new to android and I tried to implement onclicklistener on image view. But it's not working.. Please help.