Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6923683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:34:00+00:00 2026-05-27T10:34:00+00:00

I am having a hard time wrapping my head around programming my AlarmManager. The

  • 0

I am having a hard time wrapping my head around programming my AlarmManager.

The code below pretty much just assigns the current date to a text field and gets some XML and shows it using setListAdapter. I would like for this code to run on start up and then run every 30 minutes.

     Date anotherCurDate = new Date();
          SimpleDateFormat formatter = new SimpleDateFormat("EEEE', 'MMMM dd', ' yyyy");  
          String formattedDateString = formatter.format(anotherCurDate); 

         TextView currentRoomDate = (TextView)  this.findViewById(R.id.CurrentDate); 
         currentRoomDate.setText(formattedDateString); 

 ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();


        String xml = XMLfunctions.getXML(items);
        Document doc = XMLfunctions.XMLfromString(xml);

        /*int numResults = XMLfunctions.numResults(doc);

        if((numResults <= 0)){
            Toast.makeText(MeetingManager.this, "NOT GETTING XML", Toast.LENGTH_LONG).show();  
            finish();
        } */

        Element docElem = doc.getDocumentElement();
        NodeList nodes = (NodeList)docElem.getElementsByTagName("meeting_item");

int node_number = nodes.getLength();
String node_final = String.valueOf(node_number);

        Log.d(TAG, node_final);

        for (int i = 0; i < nodes.getLength(); i++) {                           
            HashMap<String, String> map = new HashMap<String, String>();    

            Element e = (Element)nodes.item(i);

            String date_value = XMLfunctions.getValue(e, "date");

           // Log.d(TAG, date_value);
            //Log.d(TAG, formattedDateString);
                //if (date_value == formattedDateString){
                    map.put("time", XMLfunctions.getValue(e, "time"));
                    map.put("endtime", XMLfunctions.getValue(e, "endtime"));
                    map.put("name", XMLfunctions.getValue(e, "meeting_name"));
                    map.put("hostname", XMLfunctions.getValue(e, "host_name"));
                    mylist.add(map);
                //}


        }       

        ListAdapter adapter = new SimpleAdapter(MeetingManager.this, mylist , R.layout.listlayout, 
                        new String[] {"time","endtime", "name", "hostname" }, 
                        new int[] { R.id.time, R.id.endtime, R.id.meeting_name, R.id.host });

       setListAdapter(adapter);





     Intent mRefreshIntent = new Intent().setComponent(new ComponentName(getBaseContext(), UpdateData.class)).setAction("com.MeetingManager.UpdateData");

    PendingIntent mPendingRefreshIntent = PendingIntent.getBroadcast(getBaseContext(), 0, mRefreshIntent, PendingIntent.FLAG_CANCEL_CURRENT); //choose your desired flag


    AlarmManager mAlarmManager = null;

    mAlarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, System.currentTimeMillis(), AlarmManager.INTERVAL_HALF_HOUR, mPendingRefreshIntent);

And here is my UpdateData class:

package com.MeetingManager;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class UpdateData extends BroadcastReceiver {


        private static final String TAG = "MyApp";

        @Override
        public void onReceive(Context context, Intent intent) {
              Log.d(TAG, "HELLO UPDATE");
        }
    }

Here is my Manifest file:

        <receiver android:name="UpdateData">
    <intent-filter>
        <action android:name="com.MeetingManager.UpdateData" />
        <action android:name="android.intent.action.BOOT_COMPLETED" />
        <category android:name="android.intent.category.HOME" />
    </intent-filter>
</receiver>

Can anyone please give me advice on what I am doing wrong.

Below is the output of my debug:

<terminated>MeetingManager [Android Application]    
    <disconnected>DalvikVM[localhost:8615]  
MeetingManager [Android Application]    
    DalvikVM[localhost:8615]    
        Thread [<1> main] (Suspended (exception RuntimeException))  
            ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2663  
            ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2679   
            ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125 
            ActivityThread$H.handleMessage(Message) line: 2033  
            ActivityThread$H(Handler).dispatchMessage(Message) line: 99 
            Looper.loop() line: 123 
            ActivityThread.main(String[]) line: 4627    
            Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
            Method.invoke(Object, Object...) line: 521  
            ZygoteInit$MethodAndArgsCaller.run() line: 868  
            ZygoteInit.main(String[]) line: 626 
            NativeStart.main(String[]) line: not available [native method]  
        Thread [<6> Binder Thread #2] (Running) 
        Thread [<5> Binder Thread #1] (Running) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:34:00+00:00Added an answer on May 27, 2026 at 10:34 am

    It appears like you are trying to use a Broadcast Receiver as if it was a service. One option would be to turn the BR into a service and change the pending intent to launch that service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a hard time wrapping my head around Java generic types. Here's a
I'm having a hard time wrapping my head around this and need some help
I'm having a hard time wrapping my head around non-static nested classes in Java.
I'm having a very hard time wrapping my head around this problem (it might
I'm having a hard time wrapping my head around when LINQ accesses the database,
My title is terrible but I'm having a hard time wrapping my head around
I'm having hard time wrapping my head around this. I have an array called
Having a hard time wrapping my head around this one. I have a Page
I'm having a hard time wrapping my head around this. I'm loading up an
I'm having a hard time wrapping my head around how to merge jQuery /

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.