<commit_before># Notify

A more light interface to using the LocalBroadcastManager

## Installation

Add this line to your application's Gemfile:

    gem 'notify', :git => 'git://github.com/ulrik/notify.git'

And then execute:

    $ bundle

## Usage


### Initialize context
```ruby

class MyApp < Android::App::Application

  def onCreate
    super

    Notify.application_context = self
  end
end

```

### Receive notification
```ruby

class MainActivity < Android::App::Activity  
  include NotifiedActivity

  notify "event-name", :receive

  def receive intent
    message = intent.getExtras.get 'message'
    puts "We are in and have message: '#{message}'"
  end

end

```

### Broadcast notification

```ruby

class OtherActivity < Android::App::Activity  

  def onCreate(savedInstanceState)
    super

    Notify.broadcast "event-name" do |intent|
      intent.putExtra("message", "This is my message!")
    end
  end

end

```



<commit_msg>Updated for github<commit_after># Notify

A more light interface to using the LocalBroadcastManager

## Installation

Add this line to your application's Gemfile:

    gem 'notify', :git => 'git://github.com/ulrik/notify.git'

And then execute:

    $ bundle

## Usage


### Initialize context
```ruby

class MyApp < Android::App::Application

  def onCreate
    super

    Notify.application_context = self
  end
end

```

### Receive notification
```ruby

class MainActivity < Android::App::Activity  
  include NotifiedActivity

  notify "event-name", :receive

  def receive intent
    message = intent.getExtras.get 'message'
    puts "Notification receive with message: '#{message}'"
  end

end

```

### Broadcast notification

```ruby

class OtherActivity < Android::App::Activity  

  def onCreate(savedInstanceState)
    super

    Notify.broadcast "event-name" do |intent|
      intent.putExtra("message", "This is my message!")
    end
  end

end

```




{'fraction_non_alphanumeric': 0.11030176899063475, 'fraction_numerical': 0.0, 'mean_word_length': 3.633734939759036, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1707463', 'n_tokens_mistral': 618, 'n_tokens_neox': 561, 'n_words': 176}