android-activity

Using imageButtons to switch activities. How can I switch image in second activity based on button pressed?

我的未来我决定 提交于 2019-12-25 16:23:35
问题 I am just starting to dabble with Android development. Right now, I have a program in Android Studio that has two columns of images about 6 images each. I want to make it so if I click that image, it will appear in the new activity. Right now, I am just loading the layout like this: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); String name = intent.getStringExtra(Main.CHAMPION_NAME); setContentView(R.layout.activity

Camera Preview Session setRepeatingRequest focus issue, focuses only first time ontouch

怎甘沉沦 提交于 2019-12-25 16:09:36
问题 i have a textureview where i have implemented ontouch listener, i want when i touch the display to be able to focus, but there's a problem when setting setRepeatingRequest to build the display, it focuses only first time when i touch and after that i can touch 100x but still it has no effect, i want to enable flash on focusing and on capture but the flash stays on all the time as the camera does not focus, please help me, i'm stuck for 5 days at this task ! Here is my code : /

Camera Preview Session setRepeatingRequest focus issue, focuses only first time ontouch

大兔子大兔子 提交于 2019-12-25 16:09:15
问题 i have a textureview where i have implemented ontouch listener, i want when i touch the display to be able to focus, but there's a problem when setting setRepeatingRequest to build the display, it focuses only first time when i touch and after that i can touch 100x but still it has no effect, i want to enable flash on focusing and on capture but the flash stays on all the time as the camera does not focus, please help me, i'm stuck for 5 days at this task ! Here is my code : /

Why do i get “source not found” when I change extends Activity to extends ListActivity?

☆樱花仙子☆ 提交于 2019-12-25 15:52:23
问题 I've got a problem with this class. This Activity will be called when I press a button. When I extend Activity to this class the programm gets into the class, but when I extend ListActiviy and I click the button the debugger tells me in red words "source not found" and nothing else, not even something in the logcat. Please tell me if there is something missing in the xml-file of this activity or the manifest. This is the class activity: public class SeeAllEntriesActivity extends ListActivity

How to collect logs for every event which occurs in android device?

血红的双手。 提交于 2019-12-25 14:20:11
问题 I wanted to collect log for every event which occurs in android device like when user starts any application or when any application have notification for user. Currently I have broadcast receiver listening for every event but it did not listened to certain events, so I searched on internet and it suggested to give priority to events while registering then in manifest file. Now the question is should I give priority to every event and if yes what priority should I give them. Thanks. 回答1:

How to reference a fragment's methods from an activity?

南楼画角 提交于 2019-12-25 14:07:32
问题 I have a viewpager app that I am working on with 3 fragments. I am adding the fragments dynamically via the FragmentStatePagerAdapter like that: public class ViewPagerAdapter extends FragmentStatePagerAdapter { CharSequence Titles[]; // This will Store the Titles of the Tabs which are Going to be passed when ViewPagerAdapter is created int NumbOfTabs; // Store the number of tabs, this will also be passed when the ViewPagerAdapter is created // Build a Constructor and assign the passed Values

ClassCast Expcetion in Bar char using MPAndroidChart jar

南笙酒味 提交于 2019-12-25 14:06:46
问题 i am new in this website actually i worked on Chart technology but when i deploy this code and run it will give class cast Exception . but there is not Error on Code . please any one help me . find below Main Activity class and Main.xml . public class MainActivity extends Activity { private LinearLayout mainLayout; private PieChart mChart; // we're going to display pie chart for smartphones martket shares private float[] yData = { 5, 10, 15, 30, 40 }; private String[] xData = { "Sony",

Slower android when not connected to charger?

怎甘沉沦 提交于 2019-12-25 13:48:22
问题 I'm trying to develop simple android application which monitors specified url using http client and once defined condition is met it should perform notification actions. I have one activity which starts separate thread and put reference to it via static value. (When activity is recreated I'm chechking reference for not null to determinate if child thread was already started). In this child thread I have while loop which gets json data from url and parse it. I've noticed weird behavour (maybe

Slower android when not connected to charger?

半世苍凉 提交于 2019-12-25 13:47:26
问题 I'm trying to develop simple android application which monitors specified url using http client and once defined condition is met it should perform notification actions. I have one activity which starts separate thread and put reference to it via static value. (When activity is recreated I'm chechking reference for not null to determinate if child thread was already started). In this child thread I have while loop which gets json data from url and parse it. I've noticed weird behavour (maybe

My service stop after the back button

可紊 提交于 2019-12-25 13:35:10
问题 I have a service and an activity that communicate. When I click the button(I have galaxy s3 there is only one button) then my activity of course disapear and my service is keep running but if I click the back (touch) button then my service is destroyed. How can I change that?I want the service to keep running untill the activity destroys it. EDIT Here is the code: Service: public class MyService extends Service { private static final String TAG = "BroadcastService"; public static final String